Renamed some types Uid_t, Gid_t, Mode_t, etc. for perl5.

More space for synctree.
This commit is contained in:
Philip Homburg 2005-06-23 11:07:31 +00:00
parent 82c0b45aeb
commit 0979014807
33 changed files with 63 additions and 89 deletions

View file

@ -55,7 +55,7 @@
#endif
#ifdef OS_Minix
typedef unsigned char *caddr_t;
/* typedef unsigned char *caddr_t; */
#endif

View file

@ -691,7 +691,7 @@ sync: sync.c
synctree: synctree.c
$(CCLD) -o $@ -wo $?
@install -S 32kw $@
install -S 64kw $@
sysenv: sysenv.c
$(CCLD) -o $@ -wo $?

View file

@ -40,14 +40,12 @@ struct stat st;
char path[PATH_MAX + 1];
_PROTOTYPE(int main, (int argc, char **argv));
_PROTOTYPE(mode_t parsemode, (char *symbolic, Mode_t oldmode));
_PROTOTYPE(mode_t parsemode, (char *symbolic, mode_t oldmode));
_PROTOTYPE(int do_change, (char *name));
_PROTOTYPE(void usage, (void));
/* Parse a P1003.2 4.7.7-conformant symbolic mode. */
mode_t parsemode(symbolic, oldmode)
char *symbolic;
mode_t oldmode;
mode_t parsemode(char *symbolic, mode_t oldmode)
{
mode_t who, mask, newmode, tmpmask;
char action;

View file

@ -31,6 +31,7 @@
*-----------------------------------------------------------------------------
*/
#include <errno.h>
#include <stdlib.h>
#include <limits.h> /* NAME_MAX for maximal filename length */
#include <string.h> /* string manipulation */
@ -870,7 +871,8 @@ FILE *file1, *file2; /* The corresponding file-pointers */
inputfp = popen(buff, "r");
if (!inputfp) {
fprintf(stderr, "Can't execute diff %s %s\n", old, new);
fprintf(stderr, "Can't execute diff %s %s, popen failed with %s\n",
old, new, strerror(errno));
exit(2);
}
preoldend = -1000;
@ -993,6 +995,7 @@ FILE *file1, *file2; /* The corresponding file-pointers */
prenewend = newend;
}
}
fprintf(stderr, "pipe fd is %d\n", fileno(inputfp));
status = pclose(inputfp);
if (status != 0) diffs++;
if (!WIFEXITED(status) || WEXITSTATUS(status) > 1) severe_error = 1;

View file

@ -190,7 +190,7 @@ _PROTOTYPE(void getcount, (void));
_PROTOTYPE(void counterror, (Ino_t ino));
_PROTOTYPE(void chkcount, (void));
_PROTOTYPE(void freecount, (void));
_PROTOTYPE(void printperm, (Mode_t mode, int shift, int special, int overlay));
_PROTOTYPE(void printperm, (mode_t mode, int shift, int special, int overlay));
_PROTOTYPE(void list, (Ino_t ino, d_inode *ip));
_PROTOTYPE(int Remove, (dir_struct *dp));
_PROTOTYPE(void make_printable_name, (char *dst, char *src, int n));
@ -843,11 +843,7 @@ void freecount()
}
/* Print the inode permission bits given by mode and shift. */
void printperm(mode, shift, special, overlay)
mode_t mode;
int shift;
int special;
int overlay;
void printperm(mode_t mode, int shift, int special, int overlay)
{
if (mode >> shift & R_BIT)
putchar('r');

View file

@ -173,7 +173,7 @@ _PROTOTYPE(void getcount, (void));
_PROTOTYPE(void counterror, (Ino_t ino));
_PROTOTYPE(void chkcount, (void));
_PROTOTYPE(void freecount, (void));
_PROTOTYPE(void printperm, (Mode_t mode, int shift, int special, int overlay));
_PROTOTYPE(void printperm, (mode_t mode, int shift, int special, int overlay));
_PROTOTYPE(void list, (Ino_t ino, d_inode *ip));
_PROTOTYPE(int Remove, (dir_struct *dp));
_PROTOTYPE(void make_printable_name, (char *dst, char *src, int n));
@ -779,11 +779,7 @@ void freecount()
}
/* Print the inode permission bits given by mode and shift. */
void printperm(mode, shift, special, overlay)
mode_t mode;
int shift;
int special;
int overlay;
void printperm(mode_t mode, int shift, int special, int overlay)
{
if (mode >> shift & R_BIT)
putchar('r');

View file

@ -38,15 +38,13 @@ mode_t u_mask;
struct stat st;
_PROTOTYPE(int main, (int argc, char **argv));
_PROTOTYPE(mode_t parsemode, (char *symbolic, Mode_t oldmode));
_PROTOTYPE(mode_t parsemode, (char *symbolic, mode_t oldmode));
_PROTOTYPE(int makepath, (char *fordir));
_PROTOTYPE(int makedir, (char *dirname));
_PROTOTYPE(void usage, (void));
/* Parse a P1003.2 4.7.7-conformant symbolic mode. */
mode_t parsemode(symbolic, oldmode)
char *symbolic;
mode_t oldmode;
mode_t parsemode(char *symbolic, mode_t oldmode)
{
mode_t who, mask, newmode, tmpmask;
char action;

View file

@ -29,13 +29,11 @@
mode_t u_mask;
_PROTOTYPE(int main, (int argc, char **argv));
_PROTOTYPE(mode_t parsemode, (char *symbolic, Mode_t oldmode));
_PROTOTYPE(mode_t parsemode, (char *symbolic, mode_t oldmode));
_PROTOTYPE(void usage, (void));
/* Parse a P1003.2 4.7.7-conformant symbolic mode. */
mode_t parsemode(symbolic, oldmode)
char *symbolic;
mode_t oldmode;
mode_t parsemode(char *symbolic, mode_t oldmode)
{
mode_t who, mask, newmode, tmpmask;
char action;

View file

@ -61,7 +61,7 @@ struct flock {
/* Function Prototypes. */
_PROTOTYPE( int creat, (const char *_path, Mode_t _mode) );
_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, ...) );

View file

@ -15,7 +15,7 @@ struct group {
};
/* Function Prototypes. */
_PROTOTYPE( struct group *getgrgid, (Gid_t _gid) );
_PROTOTYPE( struct group *getgrgid, (_mnx_Gid_t _gid) );
_PROTOTYPE( struct group *getgrnam, (const char *_name) );
#ifdef _MINIX

View file

@ -22,7 +22,7 @@ struct passwd {
/* Function Prototypes. */
_PROTOTYPE( struct passwd *getpwnam, (const char *_name) );
_PROTOTYPE( struct passwd *getpwuid, (Uid_t _uid) );
_PROTOTYPE( struct passwd *getpwuid, (_mnx_Uid_t _uid) );
#ifdef _MINIX
_PROTOTYPE( void endpwent, (void) );

View file

@ -13,6 +13,7 @@
#ifndef _MINIX__TYPES_H
#include <sys/types.h>
#endif
#include <minix/config.h>
#if (_WORD_SIZE != 2 && _WORD_SIZE != 4) || \
(_PTR_SIZE != _WORD_SIZE && _PTR_SIZE != 2*_WORD_SIZE)

View file

@ -65,12 +65,12 @@ struct stat {
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* is a sym link */
/* Function Prototypes. */
_PROTOTYPE( int chmod, (const char *_path, Mode_t _mode) );
_PROTOTYPE( int chmod, (const char *_path, _mnx_Mode_t _mode) );
_PROTOTYPE( int fstat, (int _fildes, struct stat *_buf) );
_PROTOTYPE( int mkdir, (const char *_path, Mode_t _mode) );
_PROTOTYPE( int mkfifo, (const char *_path, Mode_t _mode) );
_PROTOTYPE( int mkdir, (const char *_path, _mnx_Mode_t _mode) );
_PROTOTYPE( int mkfifo, (const char *_path, _mnx_Mode_t _mode) );
_PROTOTYPE( int stat, (const char *_path, struct stat *_buf) );
_PROTOTYPE( mode_t umask, (Mode_t _cmask) );
_PROTOTYPE( mode_t umask, (_mnx_Mode_t _cmask) );
/* Open Group Base Specifications Issue 6 (not complete) */
_PROTOTYPE( int lstat, (const char *_path, struct stat *_buf) );

View file

@ -81,9 +81,9 @@ typedef struct { u32_t _[2]; } u64_t;
* is clearer.
*/
typedef int Dev_t;
typedef int Gid_t;
typedef int _mnx_Gid_t;
typedef int Nlink_t;
typedef int Uid_t;
typedef int _mnx_Uid_t;
typedef int U8_t;
typedef unsigned long U32_t;
typedef int I8_t;
@ -105,14 +105,14 @@ typedef unsigned long Ino_t;
typedef unsigned int Zone1_t;
typedef unsigned int Bitchunk_t;
typedef unsigned int U16_t;
typedef unsigned int Mode_t;
typedef unsigned int _mnx_Mode_t;
#else /* _EM_WSIZE == 4, or _EM_WSIZE undefined */
/*typedef int Ino_t; Ino_t is now 32 bits */
typedef int Zone1_t;
typedef int Bitchunk_t;
typedef int U16_t;
typedef int Mode_t;
typedef int _mnx_Mode_t;
#endif /* _EM_WSIZE == 2, etc */
@ -124,5 +124,6 @@ typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef char *caddr_t;
#endif /* _TYPES_H */

View file

@ -85,7 +85,7 @@ _PROTOTYPE( void _exit, (int _status) );
_PROTOTYPE( int access, (const char *_path, int _amode) );
_PROTOTYPE( unsigned int alarm, (unsigned int _seconds) );
_PROTOTYPE( int chdir, (const char *_path) );
_PROTOTYPE( int chown, (const char *_path, Uid_t _owner, Gid_t _group) );
_PROTOTYPE( int chown, (const char *_path, _mnx_Uid_t _owner, _mnx_Gid_t _group) );
_PROTOTYPE( int close, (int _fd) );
_PROTOTYPE( char *ctermid, (char *_s) );
_PROTOTYPE( char *cuserid, (char *_s) );
@ -118,10 +118,10 @@ _PROTOTYPE( int pause, (void) );
_PROTOTYPE( int pipe, (int _fildes[2]) );
_PROTOTYPE( ssize_t read, (int _fd, void *_buf, size_t _n) );
_PROTOTYPE( int rmdir, (const char *_path) );
_PROTOTYPE( int setgid, (Gid_t _gid) );
_PROTOTYPE( int setgid, (_mnx_Gid_t _gid) );
_PROTOTYPE( int setpgid, (pid_t _pid, pid_t _pgid) );
_PROTOTYPE( pid_t setsid, (void) );
_PROTOTYPE( int setuid, (Uid_t _uid) );
_PROTOTYPE( int setuid, (_mnx_Uid_t _uid) );
_PROTOTYPE( unsigned int sleep, (unsigned int _seconds) );
_PROTOTYPE( long sysconf, (int _name) );
_PROTOTYPE( pid_t tcgetpgrp, (int _fd) );
@ -139,8 +139,8 @@ _PROTOTYPE( int symlink, (const char *path1, const char *path2) );
#endif
_PROTOTYPE( int brk, (char *_addr) );
_PROTOTYPE( int chroot, (const char *_name) );
_PROTOTYPE( int mknod, (const char *_name, Mode_t _mode, Dev_t _addr) );
_PROTOTYPE( int mknod4, (const char *_name, Mode_t _mode, Dev_t _addr,
_PROTOTYPE( int mknod, (const char *_name, _mnx_Mode_t _mode, Dev_t _addr) );
_PROTOTYPE( int mknod4, (const char *_name, _mnx_Mode_t _mode, Dev_t _addr,
long _size) );
_PROTOTYPE( char *mktemp, (char *_template) );
_PROTOTYPE( int mount, (char *_spec, char *_name, int _flag) );

View file

@ -127,7 +127,7 @@ struct group *getgrent(void)
}
}
struct group *getgrgid(Gid_t gid)
struct group *getgrgid(_mnx_Gid_t gid)
/* Return the group file entry belonging to the user-id. */
{
struct group *gr;

View file

@ -120,7 +120,7 @@ struct passwd *getpwent(void)
}
}
struct passwd *getpwuid(Uid_t uid)
struct passwd *getpwuid(_mnx_Uid_t uid)
/* Return the password file entry belonging to the user-id. */
{
struct passwd *pw;

View file

@ -4,7 +4,7 @@
PUBLIC int chmod(name, mode)
_CONST char *name;
Mode_t mode;
_mnx_Mode_t mode;
{
message m;

View file

@ -5,8 +5,8 @@
PUBLIC int chown(name, owner, grp)
_CONST char *name;
Uid_t owner;
Gid_t grp;
_mnx_Uid_t owner;
_mnx_Gid_t grp;
{
message m;

View file

@ -4,7 +4,7 @@
PUBLIC int creat(name, mode)
_CONST char *name;
Mode_t mode;
_mnx_Mode_t mode;
{
message m;

View file

@ -5,7 +5,7 @@
PUBLIC int mkdir(name, mode)
_CONST char *name;
Mode_t mode;
_mnx_Mode_t mode;
{
message m;

View file

@ -6,7 +6,7 @@
PUBLIC int mkfifo(name, mode)
_CONST char *name;
Mode_t mode;
_mnx_Mode_t mode;
{
return mknod(name, mode | S_IFIFO, (Dev_t) 0);
}

View file

@ -6,7 +6,7 @@
PUBLIC int mknod(name, mode, dev)
_CONST char *name;
Mode_t mode;
_mnx_Mode_t mode;
Dev_t dev;
{
message m;

View file

@ -19,7 +19,7 @@ int flags;
if (flags & O_CREAT) {
m.m1_i1 = strlen(name) + 1;
m.m1_i2 = flags;
m.m1_i3 = va_arg(argp, Mode_t);
m.m1_i3 = va_arg(argp, _mnx_Mode_t);
m.m1_p1 = (char *) name;
} else {
_loadname(name, &m);

View file

@ -3,7 +3,7 @@
#include <unistd.h>
PUBLIC int setuid(usr)
Uid_t usr;
_mnx_Uid_t usr;
{
message m;

View file

@ -3,7 +3,7 @@
#include <sys/stat.h>
PUBLIC mode_t umask(complmode)
Mode_t complmode;
_mnx_Mode_t complmode;
{
message m;

View file

@ -39,7 +39,7 @@
#define O_APPEND 0x040
int _open(const char *path, int flags);
int _creat(const char *path, Mode_t mode);
int _creat(const char *path, _mnx_Mode_t mode);
int _close(int d);
FILE *

View file

@ -24,7 +24,7 @@
#define O_APPEND 0x040
int _open(const char *path, int flags);
int _creat(const char *path, Mode_t mode);
int _creat(const char *path, _mnx_Mode_t mode);
int _close(int d);
FILE *

View file

@ -14,11 +14,7 @@
/*===========================================================================*
* get_fd *
*===========================================================================*/
PUBLIC int get_fd(start, bits, k, fpt)
int start; /* start of search (used for F_DUPFD) */
mode_t bits; /* mode of the file to be created (RWX bits) */
int *k; /* place to return file descriptor */
struct filp **fpt; /* place to return filp slot */
PUBLIC int get_fd(int start, mode_t bits, int *k, struct filp **fpt)
{
/* Look for a free file descriptor and a free filp slot. Fill in the mode word
* in the latter, but don't claim either one yet, since the open() or creat()
@ -78,9 +74,7 @@ int fild; /* file descriptor */
/*===========================================================================*
* find_filp *
*===========================================================================*/
PUBLIC struct filp *find_filp(rip, bits)
register struct inode *rip; /* inode referred to by the filp to be found */
Mode_t bits; /* mode of the filp to be found (RWX bits) */
PUBLIC struct filp *find_filp(register struct inode *rip, mode_t bits)
{
/* Find a filp slot that refers to the inode 'rip' in a way as described
* by the mode bit 'bits'. Used for determining whether somebody is still

View file

@ -102,9 +102,7 @@ register struct inode *rip; /* pointer to inode to be released */
/*===========================================================================*
* alloc_inode *
*===========================================================================*/
PUBLIC struct inode *alloc_inode(dev, bits)
dev_t dev; /* device on which to allocate the inode */
mode_t bits; /* mode of the inode */
PUBLIC struct inode *alloc_inode(dev_t dev, mode_t bits)
{
/* Allocate a free inode on 'dev', and return a pointer to it. */

View file

@ -28,9 +28,9 @@
PRIVATE char mode_map[] = {R_BIT, W_BIT, R_BIT|W_BIT, 0};
FORWARD _PROTOTYPE( int common_open, (int oflags, Mode_t omode) );
FORWARD _PROTOTYPE( int pipe_open, (struct inode *rip,Mode_t bits,int oflags));
FORWARD _PROTOTYPE( struct inode *new_node, (char *path, Mode_t bits,
FORWARD _PROTOTYPE( int common_open, (int oflags, mode_t omode) );
FORWARD _PROTOTYPE( int pipe_open, (struct inode *rip,mode_t bits,int oflags));
FORWARD _PROTOTYPE( struct inode *new_node, (char *path, mode_t bits,
zone_t z0) );
@ -75,9 +75,7 @@ PUBLIC int do_open()
/*===========================================================================*
* common_open *
*===========================================================================*/
PRIVATE int common_open(oflags, omode)
register int oflags;
mode_t omode;
PRIVATE int common_open(register int oflags, mode_t omode)
{
/* Common code from do_creat and do_open. */
@ -202,10 +200,7 @@ mode_t omode;
/*===========================================================================*
* new_node *
*===========================================================================*/
PRIVATE struct inode *new_node(path, bits, z0)
char *path; /* pointer to path name */
mode_t bits; /* mode of the new inode */
zone_t z0; /* zone number 0 for new inode */
PRIVATE struct inode *new_node(char *path, mode_t bits, zone_t z0)
{
/* New_node() is called by common_open(), do_mknod(), and do_mkdir().
* In all cases it allocates a new inode, makes a directory entry for it on
@ -267,10 +262,8 @@ zone_t z0; /* zone number 0 for new inode */
/*===========================================================================*
* pipe_open *
*===========================================================================*/
PRIVATE int pipe_open(rip, bits, oflags)
register struct inode *rip;
register mode_t bits;
register int oflags;
PRIVATE int pipe_open(register struct inode *rip, register mode_t bits,
register int oflags)
{
/* This function is called from common_open. It checks if
* there is at least one reader/writer pair for the pipe, if not

View file

@ -140,9 +140,7 @@ PUBLIC int do_access()
/*===========================================================================*
* forbidden *
*===========================================================================*/
PUBLIC int forbidden(rip, access_desired)
register struct inode *rip; /* pointer to inode to be checked */
mode_t access_desired; /* RWX bits */
PUBLIC int forbidden(register struct inode *rip, mode_t access_desired)
{
/* Given a pointer to an inode, 'rip', and the access desired, determine
* if the access is allowed, and if not why not. The routine looks up the

View file

@ -50,12 +50,12 @@ _PROTOTYPE( void map_controllers, (void) );
_PROTOTYPE( int map_driver, (int major, int proc_nr, int dev_style) );
/* filedes.c */
_PROTOTYPE( struct filp *find_filp, (struct inode *rip, Mode_t bits) );
_PROTOTYPE( int get_fd, (int start, Mode_t bits, int *k, struct filp **fpt) );
_PROTOTYPE( struct filp *find_filp, (struct inode *rip, mode_t bits) );
_PROTOTYPE( int get_fd, (int start, mode_t bits, int *k, struct filp **fpt) );
_PROTOTYPE( struct filp *get_filp, (int fild) );
/* inode.c */
_PROTOTYPE( struct inode *alloc_inode, (Dev_t dev, Mode_t bits) );
_PROTOTYPE( struct inode *alloc_inode, (dev_t dev, mode_t bits) );
_PROTOTYPE( void dup_inode, (struct inode *ip) );
_PROTOTYPE( void free_inode, (Dev_t dev, Ino_t numb) );
_PROTOTYPE( struct inode *get_inode, (Dev_t dev, int numb) );
@ -128,7 +128,7 @@ _PROTOTYPE( int do_access, (void) );
_PROTOTYPE( int do_chmod, (void) );
_PROTOTYPE( int do_chown, (void) );
_PROTOTYPE( int do_umask, (void) );
_PROTOTYPE( int forbidden, (struct inode *rip, Mode_t access_desired) );
_PROTOTYPE( int forbidden, (struct inode *rip, mode_t access_desired) );
_PROTOTYPE( int read_only, (struct inode *ip) );
/* read.c */