Giovanni's symlink patches (includes only)

This commit is contained in:
Ben Gras 2005-10-31 14:14:54 +00:00
parent 2c704d288f
commit 4c648c343e
6 changed files with 23 additions and 11 deletions

View file

@ -73,6 +73,7 @@ extern int errno; /* place where the error numbers go */
#define ENOLCK (_SIGN 37) /* no locks available */
#define ENOSYS (_SIGN 38) /* function not implemented */
#define ENOTEMPTY (_SIGN 39) /* directory not empty */
#define ELOOP (_SIGN 40) /* too many levels of symlinks detected */
/* The following errors relate to networking. */
#define EPACKSIZE (_SIGN 50) /* invalid packet size for some protocol */

View file

@ -64,4 +64,12 @@ _PROTOTYPE( int creat, (const char *_path, _mnx_Mode_t _mode) );
_PROTOTYPE( int fcntl, (int _filedes, int _cmd, ...) );
_PROTOTYPE( int open, (const char *_path, int _oflag, ...) );
/* For locking files. */
#define LOCK_SH F_RDLCK /* Shared lock */
#define LOCK_EX F_WRLCK /* Exclusive lock */
#define LOCK_NB 0x0080 /* Do not block when locking */
#define LOCK_UN F_UNLCK /* Unlock */
_PROTOTYPE( int flock, (int fd, int mode) );
#endif /* _FCNTL_H */

View file

@ -39,9 +39,12 @@
#define DUP 41
#define PIPE 42
#define TIMES 43
#define SYMLINK 45
#define SETGID 46
#define GETGID 47
#define SIGNAL 48
#define RDLNK 49
#define LSTAT 50
#define IOCTL 54
#define FCNTL 55
#define EXEC 59

View file

@ -96,6 +96,7 @@
/* Flag bits for i_mode in the inode. */
#define I_TYPE 0170000 /* this field gives inode type */
#define I_SYMBOLIC_LINK 0120000 /* file is a symbolic link */
#define I_REGULAR 0100000 /* regular file, not dir or special */
#define I_BLOCK_SPECIAL 0060000 /* block special file */
#define I_DIRECTORY 0040000 /* file is a directory */
@ -119,6 +120,8 @@
#define MAX_INODE_NR ((ino_t) 037777777777) /* largest inode number */
#define MAX_FILE_POS ((off_t) 037777777777) /* largest legal file offset */
#define MAX_SYM_LOOPS 8 /* how many symbolic links are recursed */
#define NO_BLOCK ((block_t) 0) /* absence of a block number */
#define NO_ENTRY ((ino_t) 0) /* absence of a dir entry */
#define NO_ZONE ((zone_t) 0) /* absence of a zone number */

View file

@ -29,14 +29,14 @@ struct stat {
* extensions such as S_IFREG != (mode_t) S_IFREG when ints are 32 bits.
*/
#define S_IFMT ((mode_t) 0170000) /* type of file */
#define S_IFLNK ((mode_t) 0120000) /* symbolic link, not implemented */
#define S_IFLNK ((mode_t) 0120000) /* symbolic link */
#define S_IFREG ((mode_t) 0100000) /* regular */
#define S_IFBLK 0060000 /* block special */
#define S_IFDIR 0040000 /* directory */
#define S_IFCHR 0020000 /* character special */
#define S_IFIFO 0010000 /* this is a FIFO */
#define S_ISUID 0004000 /* set user id on execution */
#define S_ISGID 0002000 /* set group id on execution */
#define S_IFBLK ((mode_t) 0060000) /* block special */
#define S_IFDIR ((mode_t) 0040000) /* directory */
#define S_IFCHR ((mode_t) 0020000) /* character special */
#define S_IFIFO ((mode_t) 0010000) /* this is a FIFO */
#define S_ISUID ((mode_t) 0004000) /* set user id on execution */
#define S_ISGID ((mode_t) 0002000) /* set group id on execution */
/* next is reserved for future use */
#define S_ISVTX 01000 /* save swapped text even after use */
@ -61,6 +61,7 @@ struct stat {
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) /* is a directory */
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) /* is a char spec */
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) /* is a block spec */
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* is a symlink */
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* is a pipe/FIFO */
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* is a sym link */

View file

@ -182,8 +182,4 @@ _PROTOTYPE( int setgroups, (int ngroups, const gid_t *gidset) );
#endif
_PROTOTYPE( int readlink, (const char *, char *, int));
_PROTOTYPE( int getopt, (int, char **, char *));
extern int optind, opterr, optopt;
#endif /* _UNISTD_H */