source: rtems/cpukit/libmisc/shell/main_mount_nfs.c @ 1ff9922

4.104.114.95
Last change on this file since 1ff9922 was 1ff9922, checked in by Chris Johns <chrisj@…>, on 12/22/07 at 08:27:18

2007-12-22 Chris Johns <chrisj@…>

  • configure.ac: fixed bug that always enabled strict order mutexes.
  • score/inline/rtems/score/coremutex.inl: Fixed coding standard.
  • score/src/coremutex.c: Add the holder's thread to the lock_mutex list if the mutex is initialised locked.
  • libnetworking/rtems/rtems_glue.c: Changed semaphore error message to show the error is an rtems-net error.
  • libmisc/monitor/mon-network.c: Removed warnings.
  • telnetd/icmds.c: Changed shell_* to rtems_shell_*.
  • score/Makefile.am: Fixed typo that stopped 'make tags' working.
  • libmisc/shell/err.c, libmisc/shell/err.h, libmisc/shell/errx.c, libmisc/shell/extern-cp.h, libmisc/shell/fts.c, libmisc/shell/fts.h, libmisc/shell/main_cp.c, libmisc/shell/utils-cp.c, libmisc/shell/verr.c, libmisc/shell/verrx.c, libmisc/shell/vwarn.c, libmisc/shell/vwarnx.c, libmisc/shell/warn.c, libmisc/shell/warnx.c: New. Ported from BSD.
  • libmisc/shell/shellconfig.h: Add the cp command.
  • libmisc/Makefile.am: Add the new files to the shell.
  • libmisc/shell/shell.c, libmisc/shell/shell.h: Add scripting support.
  • libblock/src/flashdisk.c: Fixed disk drive count size setting bug.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *   Shell Command Implmentation
3 *
4 *  Author: Fernando RUIZ CASAS
5 *  Work: fernando.ruiz@ctv.es
6 *  Home: correo@fernando-ruiz.com
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#ifdef HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <stdio.h>
20#include <unistd.h>
21#include <string.h>
22#include <errno.h>
23
24#include <rtems.h>
25#include <rtems/shell.h>
26#include "internal.h"
27
28#include <librtemsNfs.h>
29
30static int
31rtems_shell_nfs_mounter (const char*                device,
32                         const char*                mntpoint,
33                         rtems_shell_filesystems_t* fs,
34                         rtems_filesystem_options_t options)
35{
36  char* uidhost;
37  char* path;
38  int   ret;
39
40  if (strchr (device, ':') == NULL)
41  {
42    fprintf (stdout, "error: nfs mount device is [uid.gid@]host:path\n");
43    return -1;
44  }
45
46  if (rpcUdpInit () < 0)
47  {
48    fprintf (stdout, "error: initialising RPC\n");
49    return -1;
50  }
51
52  nfsInit (0, 0);
53 
54  uidhost = strdup (device);
55  path = strchr (uidhost, ':');
56  *path = '\0';
57  path++;
58 
59  ret = nfsMount(uidhost, path, (char*) mntpoint);
60
61  free (uidhost);
62
63  return ret;
64}
65
66rtems_shell_filesystems_t rtems_shell_Mount_NFS = {
67  name:          "nfs",
68  driver_needed: 1,
69  fs_ops:        NULL,
70  mounter:       rtems_shell_nfs_mounter
71};
Note: See TracBrowser for help on using the repository browser.