From: Kees van Reeuwijk Date: Tue, 13 Apr 2010 10:58:41 +0000 (+0000) Subject: Remove the types Dev_t, _mnx_Gui, _mnx_Uid, and similar. X-Git-Tag: v3.1.7~149 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.rndc.html?a=commitdiff_plain;h=bc314bda911828d2f196c4123bb65e1f42b4af8d;p=minix.git Remove the types Dev_t, _mnx_Gui, _mnx_Uid, and similar. Use ANSI-style function declarations where necessary. --- diff --git a/commands/elvis/prsvunix.c b/commands/elvis/prsvunix.c index c42e66b1a..4af722e66 100644 --- a/commands/elvis/prsvunix.c +++ b/commands/elvis/prsvunix.c @@ -9,7 +9,6 @@ #include #include #endif -extern struct passwd *getpwuid(); /* This variable is used to add extra error messages for mail sent to root */ char *ps; diff --git a/commands/ps/ps.c b/commands/ps/ps.c index 676e10d2d..46dd2fe19 100644 --- a/commands/ps/ps.c +++ b/commands/ps/ps.c @@ -178,7 +178,7 @@ struct pstat { /* structure filled by pstat() */ #define R_STATE 'R' /* Runnable */ #define T_STATE 'T' /* stopped (Trace) */ -_PROTOTYPE(char *tname, (Dev_t dev_nr )); +_PROTOTYPE(char *tname, (dev_t dev_nr )); _PROTOTYPE(char *taskname, (int p_nr )); _PROTOTYPE(char *prrecv, (struct pstat *bufp )); _PROTOTYPE(void disaster, (int sig )); @@ -198,8 +198,7 @@ _PROTOTYPE(int gettynames, (void)); * Tname assumes that the first three letters of the tty's name can be omitted * and returns the rest (except for the console, which yields "co"). */ -char *tname(dev_nr) -Dev_t dev_nr; +char *tname(dev_t dev_nr) { int i; @@ -408,13 +407,13 @@ char *argv[]; (buf.ps_flags & RTS_RECEIVING ? prrecv(&buf) : ""), - tname((Dev_t) buf.ps_dev), + tname((dev_t) buf.ps_dev), cpu, i <= init_proc_nr || buf.ps_args == NULL ? taskname(i) : buf.ps_args); else printf(S_FORMAT, - pid, tname((Dev_t) buf.ps_dev), + pid, tname((dev_t) buf.ps_dev), cpu, i <= init_proc_nr || buf.ps_args == NULL ? taskname(i) : buf.ps_args); diff --git a/commands/simple/du.c b/commands/simple/du.c index 3e26ede44..d0091235b 100644 --- a/commands/simple/du.c +++ b/commands/simple/du.c @@ -67,8 +67,8 @@ typedef struct already { _PROTOTYPE(int main, (int argc, char **argv)); _PROTOTYPE(int makedname, (char *d, char *f, char *out, int outlen)); -_PROTOTYPE(int done, (Dev_t dev, Ino_t inum, Nlink_t nlink)); -_PROTOTYPE(long dodir, (char *d, int thislev, Dev_t dev)); +_PROTOTYPE(int done, (dev_t dev, ino_t inum, nlink_t nlink)); +_PROTOTYPE(long dodir, (char *d, int thislev, dev_t dev)); char *prog; /* program name */ char *optstr = "asxdl:"; /* options */ @@ -108,10 +108,7 @@ int outlen; * done - have we encountered (dev, inum) before? Returns 1 for yes, * 0 for no, and remembers (dev, inum, nlink). */ -int done(dev, inum, nlink) -dev_t dev; -ino_t inum; -nlink_t nlink; +int done(dev_t dev, ino_t inum, nlink_t nlink) { register ALREADY **pap, *ap; @@ -168,10 +165,7 @@ int get_block_size(const char *dir, const struct stat *st) * dodir - process the directory d. Return the long size (in blocks) * of d and its descendants. */ -long dodir(d, thislev, dev) -char *d; -int thislev; -dev_t dev; +long dodir(char *d, int thislev, dev_t dev) { int maybe_print; struct stat s; diff --git a/commands/simple/fsck.c b/commands/simple/fsck.c index 371c012af..089161119 100644 --- a/commands/simple/fsck.c +++ b/commands/simple/fsck.c @@ -186,31 +186,31 @@ _PROTOTYPE(void chkword, (unsigned w1, unsigned w2, bit_nr bit, char *type, int _PROTOTYPE(void chkmap, (bitchunk_t *cmap, bitchunk_t *dmap, bit_nr bit, block_nr blkno, int nblk, char *type)); _PROTOTYPE(void chkilist, (void)); _PROTOTYPE(void getcount, (void)); -_PROTOTYPE(void counterror, (Ino_t ino)); +_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 list, (Ino_t ino, d_inode *ip)); +_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)); -_PROTOTYPE(int chkdots, (Ino_t ino, off_t pos, dir_struct *dp, Ino_t exp)); -_PROTOTYPE(int chkname, (Ino_t ino, dir_struct *dp)); -_PROTOTYPE(int chkentry, (Ino_t ino, off_t pos, dir_struct *dp)); -_PROTOTYPE(int chkdirzone, (Ino_t ino, d_inode *ip, off_t pos, zone_nr zno)); -_PROTOTYPE(int chksymlinkzone, (Ino_t ino, d_inode *ip, off_t pos, +_PROTOTYPE(int chkdots, (ino_t ino, off_t pos, dir_struct *dp, ino_t exp)); +_PROTOTYPE(int chkname, (ino_t ino, dir_struct *dp)); +_PROTOTYPE(int chkentry, (ino_t ino, off_t pos, dir_struct *dp)); +_PROTOTYPE(int chkdirzone, (ino_t ino, d_inode *ip, off_t pos, zone_nr zno)); +_PROTOTYPE(int chksymlinkzone, (ino_t ino, d_inode *ip, off_t pos, zone_nr zno)); _PROTOTYPE(void errzone, (char *mess, zone_nr zno, int level, off_t pos)); _PROTOTYPE(int markzone, (zone_nr zno, int level, off_t pos)); -_PROTOTYPE(int chkindzone, (Ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level)); +_PROTOTYPE(int chkindzone, (ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level)); _PROTOTYPE(off_t jump, (int level)); -_PROTOTYPE(int zonechk, (Ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level)); -_PROTOTYPE(int chkzones, (Ino_t ino, d_inode *ip, off_t *pos, zone_nr *zlist, int len, int level)); -_PROTOTYPE(int chkfile, (Ino_t ino, d_inode *ip)); -_PROTOTYPE(int chkdirectory, (Ino_t ino, d_inode *ip)); -_PROTOTYPE(int chklink, (Ino_t ino, d_inode *ip)); -_PROTOTYPE(int chkspecial, (Ino_t ino, d_inode *ip)); -_PROTOTYPE(int chkmode, (Ino_t ino, d_inode *ip)); -_PROTOTYPE(int chkinode, (Ino_t ino, d_inode *ip)); +_PROTOTYPE(int zonechk, (ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level)); +_PROTOTYPE(int chkzones, (ino_t ino, d_inode *ip, off_t *pos, zone_nr *zlist, int len, int level)); +_PROTOTYPE(int chkfile, (ino_t ino, d_inode *ip)); +_PROTOTYPE(int chkdirectory, (ino_t ino, d_inode *ip)); +_PROTOTYPE(int chklink, (ino_t ino, d_inode *ip)); +_PROTOTYPE(int chkspecial, (ino_t ino, d_inode *ip)); +_PROTOTYPE(int chkmode, (ino_t ino, d_inode *ip)); +_PROTOTYPE(int chkinode, (ino_t ino, d_inode *ip)); _PROTOTYPE(int descendtree, (dir_struct *dp)); _PROTOTYPE(void chktree, (void)); _PROTOTYPE(void printtotal, (void)); @@ -340,8 +340,7 @@ char *s; /* Print the pathname given by a linked list pointed to by `sp'. The * names are in reverse order. */ -void printrec(sp) -struct stack *sp; +void printrec(struct stack *sp) { if (sp->st_next != 0) { printrec(sp->st_next); @@ -839,8 +838,7 @@ void getcount() } /* The reference count for inode `ino' is wrong. Ask if it should be adjusted. */ -void counterror(ino) -ino_t ino; +void counterror(ino_t ino) { d_inode inode; @@ -904,9 +902,7 @@ void printperm(mode_t mode, int shift, int special, int overlay) } /* List the given inode. */ -void list(ino, ip) -ino_t ino; -d_inode *ip; +void list(ino_t ino, d_inode *ip) { if (firstlist) { firstlist = 0; @@ -943,8 +939,7 @@ d_inode *ip; * Don't name the function remove() - that is owned by ANSI, and chaos results * when it is a macro. */ -int Remove(dp) -dir_struct *dp; +int Remove(dir_struct *dp) { setbit(spec_imap, (bit_nr) dp->d_inum); if (yes(". remove entry")) { @@ -992,10 +987,7 @@ register int n; } /* See if the `.' or `..' entry is as expected. */ -int chkdots(ino, pos, dp, exp) -ino_t ino, exp; -off_t pos; -dir_struct *dp; +int chkdots(ino_t ino, off_t pos, dir_struct *dp, ino_t exp) { char printable_name[4 * NAME_MAX + 1]; @@ -1027,9 +1019,7 @@ dir_struct *dp; } /* Check the name in a directory entry. */ -int chkname(ino, dp) -ino_t ino; -dir_struct *dp; +int chkname(ino_t ino, dir_struct *dp) { register n = NAME_MAX + 1; register char *p = dp->d_name; @@ -1057,10 +1047,7 @@ dir_struct *dp; /* Check a directory entry. Here the routine `descendtree' is called * recursively to check the file or directory pointed to by the entry. */ -int chkentry(ino, pos, dp) -ino_t ino; -off_t pos; -dir_struct *dp; +int chkentry(ino_t ino, off_t pos, dir_struct *dp) { if (dp->d_inum < ROOT_INODE || dp->d_inum > sb.s_ninodes) { printf("bad inode found in directory "); @@ -1108,11 +1095,7 @@ dir_struct *dp; /* Check a zone of a directory by checking all the entries in the zone. * The zone is split up into chunks to not allocate too much stack. */ -int chkdirzone(ino, ip, pos, zno) -ino_t ino; -d_inode *ip; -off_t pos; -zone_nr zno; +int chkdirzone(ino_t ino, d_inode *ip, off_t pos, zone_nr zno) { dir_struct dirblk[CDIRECT]; register dir_struct *dp; @@ -1149,11 +1132,7 @@ zone_nr zno; } -int chksymlinkzone(ino, ip, pos, zno) -ino_t ino; -d_inode *ip; -off_t pos; -zone_nr zno; +int chksymlinkzone(ino_t ino, d_inode *ip, off_t pos, zone_nr zno) { long block; size_t len; @@ -1228,12 +1207,7 @@ off_t pos; /* Check an indirect zone by checking all of its entries. * The zone is split up into chunks to not allocate too much stack. */ -int chkindzone(ino, ip, pos, zno, level) -ino_t ino; -d_inode *ip; -off_t *pos; -zone_nr zno; -int level; +int chkindzone(ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level) { zone_nr indirect[CINDIR]; register n = NR_INDIRECTS / CINDIR; @@ -1265,12 +1239,7 @@ int level; /* Check a zone, which may be either a normal data zone, a directory zone, * or an indirect zone. */ -int zonechk(ino, ip, pos, zno, level) -ino_t ino; -d_inode *ip; -off_t *pos; -zone_nr zno; -int level; +int zonechk(ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level) { if (level == 0) { if ((ip->i_mode & I_TYPE) == I_DIRECTORY && @@ -1286,13 +1255,8 @@ int level; } /* Check a list of zones given by `zlist'. */ -int chkzones(ino, ip, pos, zlist, len, level) -ino_t ino; -d_inode *ip; -off_t *pos; -zone_nr *zlist; -int len; -int level; +int chkzones(ino_t ino, d_inode *ip, off_t *pos, zone_nr *zlist, + int len, int level) { register ok = 1, i; @@ -1312,9 +1276,7 @@ int level; } /* Check a file or a directory. */ -int chkfile(ino, ip) -ino_t ino; -d_inode *ip; +int chkfile(ino_t ino, d_inode *ip) { register ok, i, level; off_t pos = 0; @@ -1326,9 +1288,7 @@ d_inode *ip; } /* Check a directory by checking the contents. Check if . and .. are present. */ -int chkdirectory(ino, ip) -ino_t ino; -d_inode *ip; +int chkdirectory(ino_t ino, d_inode *ip) { register ok; @@ -1350,9 +1310,7 @@ d_inode *ip; #ifdef I_SYMBOLIC_LINK /* Check the validity of a symbolic link. */ -int chklink(ino, ip) -ino_t ino; -d_inode *ip; +int chklink(ino_t ino, d_inode *ip) { int ok; @@ -1371,9 +1329,7 @@ d_inode *ip; #endif /* Check the validity of a special file. */ -int chkspecial(ino, ip) -ino_t ino; -d_inode *ip; +int chkspecial(ino_t ino, d_inode *ip) { int i, ok; @@ -1398,9 +1354,7 @@ d_inode *ip; } /* Check the mode and contents of an inode. */ -int chkmode(ino, ip) -ino_t ino; -d_inode *ip; +int chkmode(ino_t ino, d_inode *ip) { switch (ip->i_mode & I_TYPE) { case I_REGULAR: @@ -1433,9 +1387,7 @@ d_inode *ip; } /* Check an inode. */ -int chkinode(ino, ip) -ino_t ino; -d_inode *ip; +int chkinode(ino_t ino, d_inode *ip) { if (ino == ROOT_INODE && (ip->i_mode & I_TYPE) != I_DIRECTORY) { printf("root inode is not a directory "); diff --git a/include/fcntl.h b/include/fcntl.h index d252a9ede..b9e3ef279 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -64,7 +64,7 @@ struct flock { }; /* Function Prototypes. */ -_PROTOTYPE( int creat, (const char *_path, _mnx_Mode_t _mode) ); +_PROTOTYPE( int creat, (const char *_path, mode_t _mode) ); _PROTOTYPE( int fcntl, (int _filedes, int _cmd, ...) ); _PROTOTYPE( int open, (const char *_path, int _oflag, ...) ); diff --git a/include/grp.h b/include/grp.h index e0f85ae82..41dc69baa 100644 --- a/include/grp.h +++ b/include/grp.h @@ -15,7 +15,7 @@ struct group { }; /* Function Prototypes. */ -_PROTOTYPE( struct group *getgrgid, (_mnx_Gid_t _gid) ); +_PROTOTYPE( struct group *getgrgid, (gid_t _gid) ); _PROTOTYPE( struct group *getgrnam, (const char *_name) ); #ifdef _MINIX diff --git a/include/minix/types.h b/include/minix/types.h index e78c51cb6..e84537222 100644 --- a/include/minix/types.h +++ b/include/minix/types.h @@ -110,10 +110,6 @@ typedef short uid_t; /* user id */ * sufficient to just use int instead of dev_t in the prototypes, but Dev_t * is clearer. */ -typedef int Dev_t; -typedef int _mnx_Gid_t; -typedef int Nlink_t; -typedef int _mnx_Uid_t; typedef unsigned long U32_t; typedef int I16_t; typedef long I32_t; @@ -123,14 +119,12 @@ typedef long I32_t; typedef unsigned int Zone1_t; typedef unsigned int Bitchunk_t; typedef unsigned int U16_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 _mnx_Mode_t; #endif /* _EM_WSIZE == 2, etc */ diff --git a/include/pwd.h b/include/pwd.h index c3c7959bf..658d6e5c6 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -21,7 +21,7 @@ struct passwd { /* Function Prototypes. */ _PROTOTYPE( struct passwd *getpwnam, (const char *_name) ); -_PROTOTYPE( struct passwd *getpwuid, (_mnx_Uid_t _uid) ); +_PROTOTYPE( struct passwd *getpwuid, (uid_t _uid) ); #ifdef _MINIX _PROTOTYPE( void endpwent, (void) ); diff --git a/include/sys/stat.h b/include/sys/stat.h index 736d24275..785039a68 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -66,13 +66,13 @@ struct stat { #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* is a pipe/FIFO */ /* Function Prototypes. */ -_PROTOTYPE( int chmod, (const char *_path, _mnx_Mode_t _mode) ); -_PROTOTYPE( int fchmod, (int fd, _mnx_Mode_t _mode) ); +_PROTOTYPE( int chmod, (const char *_path, mode_t _mode) ); +_PROTOTYPE( int fchmod, (int fd, mode_t _mode) ); _PROTOTYPE( int fstat, (int _fildes, struct stat *_buf) ); -_PROTOTYPE( int mkdir, (const char *_path, _mnx_Mode_t _mode) ); -_PROTOTYPE( int mkfifo, (const char *_path, _mnx_Mode_t _mode) ); +_PROTOTYPE( int mkdir, (const char *_path, mode_t _mode) ); +_PROTOTYPE( int mkfifo, (const char *_path, mode_t _mode) ); _PROTOTYPE( int stat, (const char *_path, struct stat *_buf) ); -_PROTOTYPE( mode_t umask, (_mnx_Mode_t _cmask) ); +_PROTOTYPE( mode_t umask, (mode_t _cmask) ); /* Open Group Base Specifications Issue 6 (not complete) */ _PROTOTYPE( int lstat, (const char *_path, struct stat *_buf) ); diff --git a/include/unistd.h b/include/unistd.h index 6746043d6..88413b4c3 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -99,8 +99,8 @@ _PROTOTYPE( int access, (const char *_path, int _amode) ); _PROTOTYPE( unsigned int alarm, (unsigned int _seconds) ); _PROTOTYPE( int chdir, (const char *_path) ); _PROTOTYPE( int fchdir, (int fd) ); -_PROTOTYPE( int chown, (const char *_path, _mnx_Uid_t _owner, _mnx_Gid_t _group) ); -_PROTOTYPE( int fchown, (int fd, _mnx_Uid_t _owner, _mnx_Gid_t _group) ); +_PROTOTYPE( int chown, (const char *_path, uid_t _owner, gid_t _group) ); +_PROTOTYPE( int fchown, (int fd, uid_t _owner, gid_t _group) ); _PROTOTYPE( int close, (int _fd) ); _PROTOTYPE( char *ctermid, (char *_s) ); _PROTOTYPE( char *cuserid, (char *_s) ); @@ -135,11 +135,11 @@ _PROTOTYPE( int pipe, (int _fildes[2]) ); _PROTOTYPE( ssize_t read, (int _fd, void *_buf, size_t _n) ); _PROTOTYPE( ssize_t pread, (int, void *, size_t, off_t) ); _PROTOTYPE( int rmdir, (const char *_path) ); -_PROTOTYPE( int setgid, (_mnx_Gid_t _gid) ); -_PROTOTYPE( int setegid, (_mnx_Gid_t _gid) ); +_PROTOTYPE( int setgid, (gid_t _gid) ); +_PROTOTYPE( int setegid, (gid_t _gid) ); _PROTOTYPE( pid_t setsid, (void) ); -_PROTOTYPE( int setuid, (_mnx_Uid_t _uid) ); -_PROTOTYPE( int seteuid, (_mnx_Uid_t _uid) ); +_PROTOTYPE( int setuid, (uid_t _uid) ); +_PROTOTYPE( int seteuid, (uid_t _uid) ); _PROTOTYPE( unsigned int sleep, (unsigned int _seconds) ); _PROTOTYPE( long sysconf, (int _name) ); _PROTOTYPE( pid_t tcgetpgrp, (int _fd) ); @@ -170,8 +170,8 @@ _PROTOTYPE( int brk, (char *_addr) ); _PROTOTYPE( int chroot, (const char *_name) ); _PROTOTYPE( int lseek64, (int _fd, u64_t _offset, int _whence, u64_t *_newpos) ); -_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, +_PROTOTYPE( int mknod, (const char *_name, mode_t _mode, dev_t _addr) ); +_PROTOTYPE( int mknod4, (const char *_name, mode_t _mode, dev_t _addr, long _size) ); _PROTOTYPE( char *mktemp, (char *_template) ); _PROTOTYPE( long ptrace, (int _req, pid_t _pid, long _addr, long _data) ); diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index 600bab945..bb2f327e2 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -477,7 +477,7 @@ PUBLIC int vm_lookup(const struct proc *proc, const vir_bytes virtual, /*===========================================================================* * vm_contiguous * *===========================================================================*/ -PUBLIC int vm_contiguous(const struct proc *targetproc, u32_t vir_buf, size_t bytes) +PUBLIC int vm_contiguous(const struct proc *targetproc, vir_bytes vir_buf, size_t bytes) { int first = 1, r; u32_t prev_phys = 0; /* Keep lints happy. */ diff --git a/kernel/arch/i386/protect.c b/kernel/arch/i386/protect.c index c009986e9..802be8320 100644 --- a/kernel/arch/i386/protect.c +++ b/kernel/arch/i386/protect.c @@ -246,10 +246,7 @@ vir_bytes size; /*===========================================================================* * int_gate * *===========================================================================*/ -PUBLIC void int_gate(vec_nr, offset, dpl_type) -const unsigned vec_nr; -const vir_bytes offset; -const unsigned dpl_type; +PUBLIC void int_gate(unsigned vec_nr, vir_bytes offset, unsigned dpl_type) { /* Build descriptor for an interrupt gate. */ register struct gatedesc_s *idp; diff --git a/lib/libc/other/getgrent.c b/lib/libc/other/getgrent.c index 63931e5bd..54978ac99 100644 --- a/lib/libc/other/getgrent.c +++ b/lib/libc/other/getgrent.c @@ -127,7 +127,7 @@ struct group *getgrent(void) } } -struct group *getgrgid(_mnx_Gid_t gid) +struct group *getgrgid(gid_t gid) /* Return the group file entry belonging to the user-id. */ { struct group *gr; diff --git a/lib/libc/other/getpwent.c b/lib/libc/other/getpwent.c index f13fbe99a..22e5dfe87 100644 --- a/lib/libc/other/getpwent.c +++ b/lib/libc/other/getpwent.c @@ -120,7 +120,7 @@ struct passwd *getpwent(void) } } -struct passwd *getpwuid(_mnx_Uid_t uid) +struct passwd *getpwuid(uid_t uid) /* Return the password file entry belonging to the user-id. */ { struct passwd *pw; diff --git a/lib/libc/posix/_chmod.c b/lib/libc/posix/_chmod.c index 0f731b68f..fe5dd802b 100644 --- a/lib/libc/posix/_chmod.c +++ b/lib/libc/posix/_chmod.c @@ -2,9 +2,7 @@ #define chmod _chmod #include -PUBLIC int chmod(name, mode) -_CONST char *name; -_mnx_Mode_t mode; +PUBLIC int chmod(const char *name, mode_t mode) { message m; diff --git a/lib/libc/posix/_chown.c b/lib/libc/posix/_chown.c index 2baf966e6..f5dc70fcd 100644 --- a/lib/libc/posix/_chown.c +++ b/lib/libc/posix/_chown.c @@ -3,10 +3,7 @@ #include #include -PUBLIC int chown(name, owner, grp) -_CONST char *name; -_mnx_Uid_t owner; -_mnx_Gid_t grp; +PUBLIC int chown(const char *name, uid_t owner, gid_t grp) { message m; diff --git a/lib/libc/posix/_creat.c b/lib/libc/posix/_creat.c index b4f475848..a862e8cfd 100644 --- a/lib/libc/posix/_creat.c +++ b/lib/libc/posix/_creat.c @@ -2,9 +2,7 @@ #define creat _creat #include -PUBLIC int creat(name, mode) -_CONST char *name; -_mnx_Mode_t mode; +PUBLIC int creat(const char *name, mode_t mode) { message m; diff --git a/lib/libc/posix/_fchmod.c b/lib/libc/posix/_fchmod.c index e10f2f707..7841ee99a 100644 --- a/lib/libc/posix/_fchmod.c +++ b/lib/libc/posix/_fchmod.c @@ -2,9 +2,7 @@ #define fchmod _fchmod #include -PUBLIC int fchmod(fd, mode) -int fd; -_mnx_Mode_t mode; +PUBLIC int fchmod(int fd, mode_t mode) { message m; diff --git a/lib/libc/posix/_fchown.c b/lib/libc/posix/_fchown.c index 49f4e7b77..6d8603d41 100644 --- a/lib/libc/posix/_fchown.c +++ b/lib/libc/posix/_fchown.c @@ -3,10 +3,7 @@ #include #include -PUBLIC int fchown(fd, owner, grp) -int fd; -_mnx_Uid_t owner; -_mnx_Gid_t grp; +PUBLIC int fchown(int fd, uid_t owner, gid_t grp) { message m; diff --git a/lib/libc/posix/_mkdir.c b/lib/libc/posix/_mkdir.c index ea6dab33a..8b9db7364 100644 --- a/lib/libc/posix/_mkdir.c +++ b/lib/libc/posix/_mkdir.c @@ -3,9 +3,7 @@ #include #include -PUBLIC int mkdir(name, mode) -_CONST char *name; -_mnx_Mode_t mode; +PUBLIC int mkdir(const char *name, mode_t mode) { message m; diff --git a/lib/libc/posix/_mkfifo.c b/lib/libc/posix/_mkfifo.c index 012c5d567..07cf53031 100644 --- a/lib/libc/posix/_mkfifo.c +++ b/lib/libc/posix/_mkfifo.c @@ -4,9 +4,7 @@ #include #include -PUBLIC int mkfifo(name, mode) -_CONST char *name; -_mnx_Mode_t mode; +PUBLIC int mkfifo(const char *name, mode_t mode) { - return mknod(name, mode | S_IFIFO, (Dev_t) 0); + return mknod(name, mode | S_IFIFO, (dev_t) 0); } diff --git a/lib/libc/posix/_mknod.c b/lib/libc/posix/_mknod.c index 6c221306f..a6c266523 100644 --- a/lib/libc/posix/_mknod.c +++ b/lib/libc/posix/_mknod.c @@ -4,10 +4,7 @@ #include #include -PUBLIC int mknod(name, mode, dev) -_CONST char *name; -_mnx_Mode_t mode; -Dev_t dev; +PUBLIC int mknod(const char *name, mode_t mode, dev_t dev) { message m; diff --git a/lib/libc/posix/_open.c b/lib/libc/posix/_open.c index cf5ea4c20..7b5790724 100644 --- a/lib/libc/posix/_open.c +++ b/lib/libc/posix/_open.c @@ -7,9 +7,7 @@ #if _ANSI PUBLIC int open(const char *name, int flags, ...) #else -PUBLIC int open(name, flags) -_CONST char *name; -int flags; +PUBLIC int open(const char *name, int flags) #endif { va_list argp; @@ -19,7 +17,7 @@ int flags; if (flags & O_CREAT) { m.m1_i1 = strlen(name) + 1; m.m1_i2 = flags; - m.m1_i3 = va_arg(argp, _mnx_Mode_t); + m.m1_i3 = va_arg(argp, mode_t); m.m1_p1 = (char *) name; } else { _loadname(name, &m); diff --git a/lib/libc/posix/_setgid.c b/lib/libc/posix/_setgid.c index 66270ad15..693cf1bcb 100644 --- a/lib/libc/posix/_setgid.c +++ b/lib/libc/posix/_setgid.c @@ -3,8 +3,7 @@ #define setegid _setegid #include -PUBLIC int setgid(grp) -gid_t grp; +PUBLIC int setgid(gid_t grp) { message m; @@ -12,8 +11,7 @@ gid_t grp; return(_syscall(MM, SETGID, &m)); } -PUBLIC int setegid(grp) -gid_t grp; +PUBLIC int setegid(gid_t grp) { message m; diff --git a/lib/libc/posix/_setuid.c b/lib/libc/posix/_setuid.c index 5eb9b9be9..8da6c589e 100644 --- a/lib/libc/posix/_setuid.c +++ b/lib/libc/posix/_setuid.c @@ -3,8 +3,7 @@ #define seteuid _seteuid #include -PUBLIC int setuid(usr) -_mnx_Uid_t usr; +PUBLIC int setuid(uid_t usr) { message m; @@ -12,8 +11,7 @@ _mnx_Uid_t usr; return(_syscall(MM, SETUID, &m)); } -PUBLIC int seteuid(usr) -_mnx_Uid_t usr; +PUBLIC int seteuid(uid_t usr) { message m; diff --git a/lib/libc/posix/_umask.c b/lib/libc/posix/_umask.c index c41f9757c..170cca193 100644 --- a/lib/libc/posix/_umask.c +++ b/lib/libc/posix/_umask.c @@ -2,8 +2,7 @@ #define umask _umask #include -PUBLIC mode_t umask(complmode) -_mnx_Mode_t complmode; +PUBLIC mode_t umask(mode_t complmode) { message m; diff --git a/lib/libc/stdio/fopen.c b/lib/libc/stdio/fopen.c index 777cc7a01..27dbd9e25 100644 --- a/lib/libc/stdio/fopen.c +++ b/lib/libc/stdio/fopen.c @@ -40,7 +40,7 @@ #define O_APPEND 0x040 int _open(const char *path, int flags); -int _creat(const char *path, _mnx_Mode_t mode); +int _creat(const char *path, mode_t mode); int _close(int d); FILE * diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c index 20a42505e..2e8014de2 100644 --- a/lib/libc/stdio/freopen.c +++ b/lib/libc/stdio/freopen.c @@ -25,7 +25,7 @@ #define O_APPEND 0x040 int _open(const char *path, int flags); -int _creat(const char *path, _mnx_Mode_t mode); +int _creat(const char *path, mode_t mode); int _close(int d); FILE * diff --git a/servers/iso9660fs/device.c b/servers/iso9660fs/device.c index 3c86e71f2..6073a7503 100644 --- a/servers/iso9660fs/device.c +++ b/servers/iso9660fs/device.c @@ -10,7 +10,7 @@ FORWARD _PROTOTYPE( int safe_io_conversion, (endpoint_t, cp_grant_id_t *, FORWARD _PROTOTYPE( void safe_io_cleanup, (cp_grant_id_t, cp_grant_id_t *, int)); FORWARD _PROTOTYPE( int gen_opcl, (endpoint_t driver_e, int op, - Dev_t dev, int proc_e, int flags)); + dev_t dev, int proc_e, int flags)); FORWARD _PROTOTYPE( int gen_io, (int task_nr, message *mess_ptr)); @@ -136,11 +136,12 @@ int gids_size; /*===========================================================================* * dev_open * *===========================================================================*/ -PUBLIC int dev_open(driver_e, dev, proc, flags) -endpoint_t driver_e; -dev_t dev; /* device to open */ -int proc; /* process to open for */ -int flags; /* mode bits and flags */ +PUBLIC int dev_open( + endpoint_t driver_e, + dev_t dev, /* device to open */ + int proc, /* process to open for */ + int flags /* mode bits and flags */ +) { int major, r; @@ -159,14 +160,15 @@ int flags; /* mode bits and flags */ /*===========================================================================* * block_dev_io * *===========================================================================*/ -PUBLIC int block_dev_io(op, dev, proc_e, buf, pos, bytes, flags) -int op; /* MFS_DEV_READ, MFS_DEV_WRITE, etc. */ -dev_t dev; /* major-minor device number */ -int proc_e; /* in whose address space is buf? */ -void *buf; /* virtual address of the buffer */ -u64_t pos; /* byte position */ -int bytes; /* how many bytes to transfer */ -int flags; /* special flags, like O_NONBLOCK */ +PUBLIC int block_dev_io( + int op, /* MFS_DEV_READ, MFS_DEV_WRITE, etc. */ + dev_t dev, /* major-minor device number */ + int proc_e, /* in whose address space is buf? */ + void *buf, /* virtual address of the buffer */ + u64_t pos, /* byte position */ + int bytes, /* how many bytes to transfer */ + int flags /* special flags, like O_NONBLOCK */ +) { /* Read or write from a device. The parameter 'dev' tells which one. */ int r, safe; @@ -258,12 +260,13 @@ int flags; /* special flags, like O_NONBLOCK */ /*===========================================================================* * gen_opcl * *===========================================================================*/ -PRIVATE int gen_opcl(driver_e, op, dev, proc_e, flags) -endpoint_t driver_e; -int op; /* operation, DEV_OPEN or DEV_CLOSE */ -dev_t dev; /* device to open or close */ -int proc_e; /* process to open/close for */ -int flags; /* mode bits and flags */ +PRIVATE int gen_opcl( + endpoint_t driver_e, + int op, /* operation, DEV_OPEN or DEV_CLOSE */ + dev_t dev, /* device to open or close */ + int proc_e, /* process to open/close for */ + int flags /* mode bits and flags */ +) { /* Called from the dmap struct in table.c on opens & closes of special files.*/ message dev_mess; diff --git a/servers/iso9660fs/proto.h b/servers/iso9660fs/proto.h index 8942286de..1302f72d1 100644 --- a/servers/iso9660fs/proto.h +++ b/servers/iso9660fs/proto.h @@ -14,9 +14,9 @@ _PROTOTYPE(struct buf *get_block,(block_t block)); _PROTOTYPE(void put_block,(struct buf *bp)); /* device.c */ -_PROTOTYPE( int block_dev_io, (int op, Dev_t dev, int proc, void *buf, +_PROTOTYPE( int block_dev_io, (int op, dev_t dev, int proc, void *buf, u64_t pos, int bytes, int flags) ); -_PROTOTYPE( int dev_open, (endpoint_t driver_e, Dev_t dev, int proc, +_PROTOTYPE( int dev_open, (endpoint_t driver_e, dev_t dev, int proc, int flags) ); _PROTOTYPE( void dev_close, (endpoint_t driver_e, dev_t dev) ); _PROTOTYPE( int fs_new_driver, (void) ); @@ -66,7 +66,7 @@ _PROTOTYPE( int fs_fstatfs, (void) ); /* super.c */ _PROTOTYPE(int release_v_pri, (struct iso9660_vd_pri *v_pri) ); -_PROTOTYPE(int read_vds, (struct iso9660_vd_pri *v_pri, Dev_t dev) ); +_PROTOTYPE(int read_vds, (struct iso9660_vd_pri *v_pri, dev_t dev) ); _PROTOTYPE(int create_v_pri, (struct iso9660_vd_pri *v_pri, char *buffer, unsigned long address) ); diff --git a/servers/iso9660fs/super.c b/servers/iso9660fs/super.c index 7e56a26be..d90b61de1 100644 --- a/servers/iso9660fs/super.c +++ b/servers/iso9660fs/super.c @@ -79,9 +79,10 @@ PUBLIC int create_v_pri(v_pri,buf,address) /* This function reads from a ISO9660 filesystem (in the device dev) the * super block and saves it in v_pri. */ -PUBLIC int read_vds(v_pri,dev) - register struct iso9660_vd_pri *v_pri; - register dev_t dev; +PUBLIC int read_vds( + register struct iso9660_vd_pri *v_pri, + register dev_t dev +) { u64_t offset; int vol_ok = FALSE; diff --git a/servers/mfs/cache.c b/servers/mfs/cache.c index 3dbb4d0bf..c17848456 100644 --- a/servers/mfs/cache.c +++ b/servers/mfs/cache.c @@ -28,10 +28,11 @@ FORWARD _PROTOTYPE( int rw_block, (struct buf *, int) ); /*===========================================================================* * get_block * *===========================================================================*/ -PUBLIC struct buf *get_block(dev, block, only_search) -register dev_t dev; /* on which device is the block? */ -register block_t block; /* which block is wanted? */ -int only_search; /* if NO_READ, don't read, else act normal */ +PUBLIC struct buf *get_block( + register dev_t dev, /* on which device is the block? */ + register block_t block, /* which block is wanted? */ + int only_search /* if NO_READ, don't read, else act normal */ +) { /* Check to see if the requested block is in the block cache. If so, return * a pointer to it. If not, evict some other block and fetch it (unless @@ -214,9 +215,10 @@ int block_type; /* INODE_BLOCK, DIRECTORY_BLOCK, or whatever */ /*===========================================================================* * alloc_zone * *===========================================================================*/ -PUBLIC zone_t alloc_zone(dev, z) -dev_t dev; /* device where zone wanted */ -zone_t z; /* try to allocate new zone near this one */ +PUBLIC zone_t alloc_zone( + dev_t dev, /* device where zone wanted */ + zone_t z /* try to allocate new zone near this one */ +) { /* Allocate a new zone on the indicated device and return its number. */ @@ -254,9 +256,10 @@ zone_t z; /* try to allocate new zone near this one */ /*===========================================================================* * free_zone * *===========================================================================*/ -PUBLIC void free_zone(dev, numb) -dev_t dev; /* device where zone located */ -zone_t numb; /* zone to be returned */ +PUBLIC void free_zone( + dev_t dev, /* device where zone located */ + zone_t numb /* zone to be returned */ +) { /* Return a zone. */ @@ -313,8 +316,9 @@ int rw_flag; /* READING or WRITING */ /*===========================================================================* * invalidate * *===========================================================================*/ -PUBLIC void invalidate(device) -dev_t device; /* device whose blocks are to be purged */ +PUBLIC void invalidate( + dev_t device /* device whose blocks are to be purged */ +) { /* Remove all the blocks belonging to some device from the cache. */ @@ -327,8 +331,9 @@ dev_t device; /* device whose blocks are to be purged */ /*===========================================================================* * flushall * *===========================================================================*/ -PUBLIC void flushall(dev) -dev_t dev; /* device to flush */ +PUBLIC void flushall( + dev_t dev /* device to flush */ +) { /* Flush all dirty blocks for one device. */ @@ -346,11 +351,12 @@ dev_t dev; /* device to flush */ /*===========================================================================* * rw_scattered * *===========================================================================*/ -PUBLIC void rw_scattered(dev, bufq, bufqsize, rw_flag) -dev_t dev; /* major-minor device number */ -struct buf **bufq; /* pointer to array of buffers */ -int bufqsize; /* number of buffers */ -int rw_flag; /* READING or WRITING */ +PUBLIC void rw_scattered( + dev_t dev, /* major-minor device number */ + struct buf **bufq, /* pointer to array of buffers */ + int bufqsize, /* number of buffers */ + int rw_flag /* READING or WRITING */ +) { /* Read or write scattered data from a device. */ diff --git a/servers/mfs/device.c b/servers/mfs/device.c index 1a8e7dd59..581d8fd22 100644 --- a/servers/mfs/device.c +++ b/servers/mfs/device.c @@ -23,7 +23,7 @@ FORWARD _PROTOTYPE( int safe_io_conversion, (endpoint_t, FORWARD _PROTOTYPE( void safe_io_cleanup, (cp_grant_id_t, cp_grant_id_t *, int)); FORWARD _PROTOTYPE( int gen_opcl, (endpoint_t driver_e, int op, - Dev_t dev, int proc_e, int flags) ); + dev_t dev, int proc_e, int flags) ); FORWARD _PROTOTYPE( int gen_io, (endpoint_t task_nr, message *mess_ptr) ); @@ -147,14 +147,15 @@ int gids_size; /*===========================================================================* * block_dev_io * *===========================================================================*/ -PUBLIC int block_dev_io(op, dev, proc_e, buf, pos, bytes, flags) -int op; /* MFS_DEV_READ, MFS_DEV_WRITE, etc. */ -dev_t dev; /* major-minor device number */ -int proc_e; /* in whose address space is buf? */ -void *buf; /* virtual address of the buffer */ -u64_t pos; /* byte position */ -int bytes; /* how many bytes to transfer */ -int flags; /* special flags, like O_NONBLOCK */ +PUBLIC int block_dev_io( + int op, /* MFS_DEV_READ, MFS_DEV_WRITE, etc. */ + dev_t dev, /* major-minor device number */ + int proc_e, /* in whose address space is buf? */ + void *buf, /* virtual address of the buffer */ + u64_t pos, /* byte position */ + int bytes, /* how many bytes to transfer */ + int flags /* special flags, like O_NONBLOCK */ +) { /* Read or write from a device. The parameter 'dev' tells which one. */ int r, safe; @@ -253,11 +254,12 @@ int flags; /* special flags, like O_NONBLOCK */ /*===========================================================================* * dev_open * *===========================================================================*/ -PUBLIC int dev_open(driver_e, dev, proc, flags) -endpoint_t driver_e; -dev_t dev; /* device to open */ -int proc; /* process to open for */ -int flags; /* mode bits and flags */ +PUBLIC int dev_open( + endpoint_t driver_e, + dev_t dev, /* device to open */ + int proc, /* process to open for */ + int flags /* mode bits and flags */ +) { int major, r; @@ -276,9 +278,10 @@ int flags; /* mode bits and flags */ /*===========================================================================* * dev_close * *===========================================================================*/ -PUBLIC void dev_close(driver_e, dev) -endpoint_t driver_e; -dev_t dev; /* device to close */ +PUBLIC void dev_close( + endpoint_t driver_e, + dev_t dev /* device to close */ +) { (void) gen_opcl(driver_e, DEV_CLOSE, dev, 0, 0); } @@ -287,12 +290,13 @@ dev_t dev; /* device to close */ /*===========================================================================* * gen_opcl * *===========================================================================*/ -PRIVATE int gen_opcl(driver_e, op, dev, proc_e, flags) -endpoint_t driver_e; -int op; /* operation, DEV_OPEN or DEV_CLOSE */ -dev_t dev; /* device to open or close */ -int proc_e; /* process to open/close for */ -int flags; /* mode bits and flags */ +PRIVATE int gen_opcl( + endpoint_t driver_e, + int op, /* operation, DEV_OPEN or DEV_CLOSE */ + dev_t dev, /* device to open or close */ + int proc_e, /* process to open/close for */ + int flags /* mode bits and flags */ +) { /* Called from the dmap struct in table.c on opens & closes of special files.*/ message dev_mess; diff --git a/servers/mfs/inode.c b/servers/mfs/inode.c index 27a65b9eb..80201e33b 100644 --- a/servers/mfs/inode.c +++ b/servers/mfs/inode.c @@ -33,7 +33,7 @@ FORWARD _PROTOTYPE( int unhash_inode, (struct inode *node) ); /*===========================================================================* * fs_putnode * *===========================================================================*/ -PUBLIC int fs_putnode() +PUBLIC int fs_putnode(void) { /* Find the inode specified by the request message and decrease its counter.*/ @@ -121,9 +121,10 @@ PRIVATE int unhash_inode(struct inode *node) /*===========================================================================* * get_inode * *===========================================================================*/ -PUBLIC struct inode *get_inode(dev, numb) -dev_t dev; /* device on which inode resides */ -int numb; /* inode number (ANSI: may not be unshort) */ +PUBLIC struct inode *get_inode( + dev_t dev, /* device on which inode resides */ + int numb /* inode number (ANSI: may not be unshort) */ +) { /* Find the inode in the hash table. If it is not there, get a free inode * load it from the disk if it's necessary and put on the hash list @@ -181,9 +182,10 @@ int numb; /* inode number (ANSI: may not be unshort) */ /*===========================================================================* * find_inode * *===========================================================================*/ -PUBLIC struct inode *find_inode(dev, numb) -dev_t dev; /* device on which inode resides */ -int numb; /* inode number (ANSI: may not be unshort) */ +PUBLIC struct inode *find_inode( + dev_t dev, /* device on which inode resides */ + int numb /* inode number (ANSI: may not be unshort) */ +) { /* Find the inode specified by the inode and device number. */ @@ -323,9 +325,10 @@ register struct inode *rip; /* the inode to be erased */ /*===========================================================================* * free_inode * *===========================================================================*/ -PUBLIC void free_inode(dev, inumb) -dev_t dev; /* on which device is the inode */ -ino_t inumb; /* number of inode to be freed */ +PUBLIC void free_inode( + dev_t dev, /* on which device is the inode? */ + ino_t inumb /* number of the inode to be freed */ +) { /* Return an inode to the pool of unallocated inodes. */ diff --git a/servers/mfs/proto.h b/servers/mfs/proto.h index f8fb1263c..1f0ab2e44 100644 --- a/servers/mfs/proto.h +++ b/servers/mfs/proto.h @@ -8,35 +8,35 @@ struct super_block; /* cache.c */ -_PROTOTYPE( zone_t alloc_zone, (Dev_t dev, zone_t z) ); +_PROTOTYPE( zone_t alloc_zone, (dev_t dev, zone_t z) ); _PROTOTYPE( void buf_pool, (void) ); -_PROTOTYPE( void flushall, (Dev_t dev) ); -_PROTOTYPE( void free_zone, (Dev_t dev, zone_t numb) ); -_PROTOTYPE( struct buf *get_block, (Dev_t dev, block_t block,int only_search)); -_PROTOTYPE( void invalidate, (Dev_t device) ); +_PROTOTYPE( void flushall, (dev_t dev) ); +_PROTOTYPE( void free_zone, (dev_t dev, zone_t numb) ); +_PROTOTYPE( struct buf *get_block, (dev_t dev, block_t block,int only_search)); +_PROTOTYPE( void invalidate, (dev_t device) ); _PROTOTYPE( void put_block, (struct buf *bp, int block_type) ); _PROTOTYPE( void set_blocksize, (int blocksize) ); -_PROTOTYPE( void rw_scattered, (Dev_t dev, +_PROTOTYPE( void rw_scattered, (dev_t dev, struct buf **bufq, int bufqsize, int rw_flag) ); /* device.c */ -_PROTOTYPE( int block_dev_io, (int op, Dev_t dev, int proc, void *buf, +_PROTOTYPE( int block_dev_io, (int op, dev_t dev, int proc, void *buf, u64_t pos, int bytes, int flags) ); -_PROTOTYPE( int dev_open, (endpoint_t driver_e, Dev_t dev, int proc, +_PROTOTYPE( int dev_open, (endpoint_t driver_e, dev_t dev, int proc, int flags) ); -_PROTOTYPE( void dev_close, (endpoint_t driver_e, Dev_t dev) ); +_PROTOTYPE( void dev_close, (endpoint_t driver_e, dev_t dev) ); _PROTOTYPE( int fs_clone_opcl, (void) ); _PROTOTYPE( int fs_new_driver, (void) ); /* inode.c */ _PROTOTYPE( struct inode *alloc_inode, (dev_t dev, mode_t bits) ); _PROTOTYPE( void dup_inode, (struct inode *ip) ); -_PROTOTYPE( struct inode *find_inode, (Dev_t dev, int numb) ); -_PROTOTYPE( void free_inode, (Dev_t dev, Ino_t numb) ); +_PROTOTYPE( struct inode *find_inode, (dev_t dev, int numb) ); +_PROTOTYPE( void free_inode, (dev_t dev, Ino_t numb) ); _PROTOTYPE( int fs_getnode, (void) ); _PROTOTYPE( int fs_putnode, (void) ); _PROTOTYPE( void init_inode_cache, (void) ); -_PROTOTYPE( struct inode *get_inode, (Dev_t dev, int numb) ); +_PROTOTYPE( struct inode *get_inode, (dev_t dev, int numb) ); _PROTOTYPE( void put_inode, (struct inode *rip) ); _PROTOTYPE( void update_times, (struct inode *rip) ); _PROTOTYPE( void rw_inode, (struct inode *rip, int rw_flag) ); @@ -104,7 +104,7 @@ _PROTOTYPE( bit_t alloc_bit, (struct super_block *sp, int map, bit_t origin)); _PROTOTYPE( void free_bit, (struct super_block *sp, int map, bit_t bit_returned) ); _PROTOTYPE( int get_block_size, (dev_t dev) ); -_PROTOTYPE( struct super_block *get_super, (Dev_t dev) ); +_PROTOTYPE( struct super_block *get_super, (dev_t dev) ); _PROTOTYPE( int mounted, (struct inode *rip) ); _PROTOTYPE( int read_super, (struct super_block *sp) ); diff --git a/servers/mfs/super.c b/servers/mfs/super.c index 207d0597d..5380429e3 100644 --- a/servers/mfs/super.c +++ b/servers/mfs/super.c @@ -145,8 +145,9 @@ bit_t bit_returned; /* number of bit to insert into the map */ /*===========================================================================* * get_super * *===========================================================================*/ -PUBLIC struct super_block *get_super(dev) -dev_t dev; /* device number whose super_block is sought */ +PUBLIC struct super_block *get_super( + dev_t dev /* device number whose super_block is sought */ +) { if (dev == NO_DEV) panic("request for super_block of NO_DEV"); diff --git a/servers/pfs/buffer.c b/servers/pfs/buffer.c index e49b1598e..1336bde9d 100644 --- a/servers/pfs/buffer.c +++ b/servers/pfs/buffer.c @@ -23,13 +23,10 @@ PUBLIC void buf_pool(void) /*===========================================================================* * get_block * *===========================================================================*/ -PUBLIC struct buf *get_block(dev, inum) -Dev_t dev; -ino_t inum; +PUBLIC struct buf *get_block(dev_t dev, ino_t inum) { - struct buf *bp; + struct buf *bp = front; - bp = front; while(bp != NIL_BUF) { if (bp->b_dev == dev && bp->b_num == inum) { bp->b_count++; @@ -46,9 +43,7 @@ ino_t inum; /*===========================================================================* * new_block * *===========================================================================*/ -PUBLIC struct buf *new_block(dev, inum) -Dev_t dev; -ino_t inum; +PUBLIC struct buf *new_block(dev_t dev, ino_t inum) { /* Allocate a new buffer and add it to the double linked buffer list */ struct buf *bp; @@ -82,9 +77,7 @@ ino_t inum; /*===========================================================================* * put_block * *===========================================================================*/ -PUBLIC void put_block(dev, inum) -dev_t dev; -ino_t inum; +PUBLIC void put_block(dev_t dev, ino_t inum) { struct buf *bp; diff --git a/servers/pfs/inode.c b/servers/pfs/inode.c index 90626f026..1fa6ed27a 100644 --- a/servers/pfs/inode.c +++ b/servers/pfs/inode.c @@ -120,9 +120,10 @@ PRIVATE int unhash_inode(struct inode *node) /*===========================================================================* * get_inode * *===========================================================================*/ -PUBLIC struct inode *get_inode(dev, numb) -dev_t dev; /* device on which inode resides */ -int numb; /* inode number (ANSI: may not be unshort) */ +PUBLIC struct inode *get_inode( + dev_t dev, /* device on which inode resides */ + int numb /* inode number (ANSI: may not be unshort) */ +) { /* Find the inode in the hash table. If it is not there, get a free inode * load it from the disk if it's necessary and put on the hash list diff --git a/servers/pfs/proto.h b/servers/pfs/proto.h index 0c4ede038..9e57652fd 100644 --- a/servers/pfs/proto.h +++ b/servers/pfs/proto.h @@ -6,9 +6,9 @@ struct filp; struct inode; /* buffer.c */ -_PROTOTYPE( struct buf *get_block, (Dev_t dev, ino_t inum) ); -_PROTOTYPE( struct buf *new_block, (Dev_t dev, ino_t inum) ); -_PROTOTYPE( void put_block, (Dev_t dev, ino_t inum) ); +_PROTOTYPE( struct buf *get_block, (dev_t dev, ino_t inum) ); +_PROTOTYPE( struct buf *new_block, (dev_t dev, ino_t inum) ); +_PROTOTYPE( void put_block, (dev_t dev, ino_t inum) ); /* cache.c */ _PROTOTYPE( void buf_pool, (void) ); @@ -20,7 +20,7 @@ _PROTOTYPE( struct inode *find_inode, (int numb) ); _PROTOTYPE( void free_inode, (struct inode *rip) ); _PROTOTYPE( int fs_putnode, (void) ); _PROTOTYPE( void init_inode_cache, (void) ); -_PROTOTYPE( struct inode *get_inode, (Dev_t dev, int numb) ); +_PROTOTYPE( struct inode *get_inode, (dev_t dev, int numb) ); _PROTOTYPE( void put_inode, (struct inode *rip) ); _PROTOTYPE( void update_times, (struct inode *rip) ); _PROTOTYPE( void wipe_inode, (struct inode *rip) ); diff --git a/servers/rs/exec.c b/servers/rs/exec.c index cda1ae715..c72335398 100644 --- a/servers/rs/exec.c +++ b/servers/rs/exec.c @@ -12,7 +12,7 @@ FORWARD _PROTOTYPE( int read_header, (char *exec, size_t exec_len, int *sep_id, FORWARD _PROTOTYPE( int exec_newmem, (int proc_e, vir_bytes text_bytes, vir_bytes data_bytes, vir_bytes bss_bytes, vir_bytes tot_bytes, vir_bytes frame_len, int sep_id, - Dev_t st_dev, ino_t st_ino, time_t st_ctime, char *progname, + dev_t st_dev, ino_t st_ino, time_t st_ctime, char *progname, int new_uid, int new_gid, vir_bytes *stack_topp, int *load_textp, int *allow_setuidp) ); FORWARD _PROTOTYPE( int exec_restart, (int proc_e, int result) ); @@ -203,25 +203,24 @@ fail: /*===========================================================================* * exec_newmem * *===========================================================================*/ -PRIVATE int exec_newmem(proc_e, text_bytes, data_bytes, bss_bytes, tot_bytes, - frame_len, sep_id, st_dev, st_ino, st_ctime, progname, - new_uid, new_gid, stack_topp, load_textp, allow_setuidp) -int proc_e; -vir_bytes text_bytes; -vir_bytes data_bytes; -vir_bytes bss_bytes; -vir_bytes tot_bytes; -vir_bytes frame_len; -int sep_id; -dev_t st_dev; -ino_t st_ino; -time_t st_ctime; -int new_uid; -int new_gid; -char *progname; -vir_bytes *stack_topp; -int *load_textp; -int *allow_setuidp; +PRIVATE int exec_newmem( + int proc_e, + vir_bytes text_bytes, + vir_bytes data_bytes, + vir_bytes bss_bytes, + vir_bytes tot_bytes, + vir_bytes frame_len, + int sep_id, + dev_t st_dev, + ino_t st_ino, + time_t st_ctime, + char *progname, + int new_uid, + int new_gid, + vir_bytes *stack_topp, + int *load_textp, + int *allow_setuidp +) { int r; struct exec_newmem e; diff --git a/servers/vfs/device.c b/servers/vfs/device.c index 5670b7b1d..655419cea 100644 --- a/servers/vfs/device.c +++ b/servers/vfs/device.c @@ -49,10 +49,11 @@ PRIVATE int dummyproc; /*===========================================================================* * dev_open * *===========================================================================*/ -PUBLIC int dev_open(dev, proc, flags) -dev_t dev; /* device to open */ -int proc; /* process to open for */ -int flags; /* mode bits and flags */ +PUBLIC int dev_open( + dev_t dev, /* device to open */ + int proc, /* process to open for */ + int flags /* mode bits and flags */ +) { int major, r; struct dmap *dp; @@ -73,10 +74,11 @@ int flags; /* mode bits and flags */ /*===========================================================================* * dev_reopen * *===========================================================================*/ -PUBLIC int dev_reopen(dev, filp_no, flags) -dev_t dev; /* device to open */ -int filp_no; /* filp to reopen for */ -int flags; /* mode bits and flags */ +PUBLIC int dev_reopen( + dev_t dev, /* device to open */ + int filp_no, /* filp to reopen for */ + int flags /* mode bits and flags */ +) { int major, r; struct dmap *dp; @@ -99,9 +101,10 @@ int flags; /* mode bits and flags */ /*===========================================================================* * dev_close * *===========================================================================*/ -PUBLIC int dev_close(dev, filp_no) -dev_t dev; /* device to close */ -int filp_no; +PUBLIC int dev_close( + dev_t dev, /* device to close */ + int filp_no +) { int r; @@ -325,15 +328,16 @@ int gids_size; /*===========================================================================* * dev_io * *===========================================================================*/ -PUBLIC int dev_io(op, dev, proc_e, buf, pos, bytes, flags, suspend_reopen) -int op; /* DEV_READ, DEV_WRITE, DEV_IOCTL, etc. */ -dev_t dev; /* major-minor device number */ -int proc_e; /* in whose address space is buf? */ -void *buf; /* virtual address of the buffer */ -u64_t pos; /* byte position */ -int bytes; /* how many bytes to transfer */ -int flags; /* special flags, like O_NONBLOCK */ -int suspend_reopen; /* Just suspend the process */ +PUBLIC int dev_io( + int op, /* DEV_READ, DEV_WRITE, DEV_IOCTL, etc. */ + dev_t dev, /* major-minor device number */ + int proc_e, /* in whose address space is buf? */ + void *buf, /* virtual address of the buffer */ + u64_t pos, /* byte position */ + int bytes, /* how many bytes to transfer */ + int flags, /* special flags, like O_NONBLOCK */ + int suspend_reopen /* Just suspend the process */ +) { /* Read or write from a device. The parameter 'dev' tells which one. */ struct dmap *dp; @@ -471,11 +475,12 @@ int suspend_reopen; /* Just suspend the process */ /*===========================================================================* * gen_opcl * *===========================================================================*/ -PUBLIC int gen_opcl(op, dev, proc_e, flags) -int op; /* operation, DEV_OPEN or DEV_CLOSE */ -dev_t dev; /* device to open or close */ -int proc_e; /* process to open/close for */ -int flags; /* mode bits and flags */ +PUBLIC int gen_opcl( + int op, /* operation, DEV_OPEN or DEV_CLOSE */ + dev_t dev, /* device to open or close */ + int proc_e, /* process to open/close for */ + int flags /* mode bits and flags */ +) { /* Called from the dmap struct in table.c on opens & closes of special files.*/ int r; @@ -505,11 +510,12 @@ int flags; /* mode bits and flags */ /*===========================================================================* * tty_opcl * *===========================================================================*/ -PUBLIC int tty_opcl(op, dev, proc_e, flags) -int op; /* operation, DEV_OPEN or DEV_CLOSE */ -dev_t dev; /* device to open or close */ -int proc_e; /* process to open/close for */ -int flags; /* mode bits and flags */ +PUBLIC int tty_opcl( + int op, /* operation, DEV_OPEN or DEV_CLOSE */ + dev_t dev, /* device to open or close */ + int proc_e, /* process to open/close for */ + int flags /* mode bits and flags */ +) { /* This procedure is called from the dmap struct on tty open/close. */ @@ -543,11 +549,12 @@ int flags; /* mode bits and flags */ /*===========================================================================* * ctty_opcl * *===========================================================================*/ -PUBLIC int ctty_opcl(op, dev, proc_e, flags) -int op; /* operation, DEV_OPEN or DEV_CLOSE */ -dev_t dev; /* device to open or close */ -int proc_e; /* process to open/close for */ -int flags; /* mode bits and flags */ +PUBLIC int ctty_opcl( + int op, /* operation, DEV_OPEN or DEV_CLOSE */ + dev_t dev, /* device to open or close */ + int proc_e, /* process to open/close for */ + int flags /* mode bits and flags */ +) { /* This procedure is called from the dmap struct in table.c on opening/closing * /dev/tty, the magic device that translates to the controlling tty. @@ -707,11 +714,12 @@ message *mess_ptr; /* pointer to message for task */ /*===========================================================================* * no_dev * *===========================================================================*/ -PUBLIC int no_dev(op, dev, proc, flags) -int op; /* operation, DEV_OPEN or DEV_CLOSE */ -dev_t dev; /* device to open or close */ -int proc; /* process to open/close for */ -int flags; /* mode bits and flags */ +PUBLIC int no_dev( + int UNUSED(op), /* operation, DEV_OPEN or DEV_CLOSE */ + dev_t UNUSED(dev), /* device to open or close */ + int UNUSED(proc), /* process to open/close for */ + int UNUSED(flags) /* mode bits and flags */ +) { /* Called when opening a nonexistent device. */ return(ENODEV); @@ -731,11 +739,12 @@ PUBLIC int no_dev_io(int proc, message *m) /*===========================================================================* * clone_opcl * *===========================================================================*/ -PUBLIC int clone_opcl(op, dev, proc_e, flags) -int op; /* operation, DEV_OPEN or DEV_CLOSE */ -dev_t dev; /* device to open or close */ -int proc_e; /* process to open/close for */ -int flags; /* mode bits and flags */ +PUBLIC int clone_opcl( + int op, /* operation, DEV_OPEN or DEV_CLOSE */ + dev_t dev, /* device to open or close */ + int proc_e, /* process to open/close for */ + int flags /* mode bits and flags */ +) { /* Some devices need special processing upon open. Such a device is "cloned", * i.e. on a succesful open it is replaced by a new device with a new unique diff --git a/servers/vfs/dmap.c b/servers/vfs/dmap.c index 0a4814c33..8048c4db1 100644 --- a/servers/vfs/dmap.c +++ b/servers/vfs/dmap.c @@ -84,7 +84,7 @@ PUBLIC int do_mapdriver() * map_driver * *===========================================================================*/ PUBLIC int map_driver(label, major, proc_nr_e, style, flags) -char *label; /* name of the driver */ +const char *label; /* name of the driver */ int major; /* major number of the device */ endpoint_t proc_nr_e; /* process number of the driver */ int style; /* style of the device */ diff --git a/servers/vfs/dmap.h b/servers/vfs/dmap.h index 62a8b97d1..ccf53e30a 100644 --- a/servers/vfs/dmap.h +++ b/servers/vfs/dmap.h @@ -13,7 +13,7 @@ dmap.h */ extern struct dmap { - int _PROTOTYPE ((*dmap_opcl), (int, Dev_t, int, int) ); + int _PROTOTYPE ((*dmap_opcl), (int, dev_t, int, int) ); int _PROTOTYPE ((*dmap_io), (int, message *) ); endpoint_t dmap_driver; char dmap_label[LABEL_MAX]; diff --git a/servers/vfs/exec.c b/servers/vfs/exec.c index c024f00fd..ec7995317 100644 --- a/servers/vfs/exec.c +++ b/servers/vfs/exec.c @@ -33,7 +33,7 @@ FORWARD _PROTOTYPE( int exec_newmem, (int proc_e, vir_bytes text_bytes, vir_bytes data_bytes, vir_bytes bss_bytes, vir_bytes tot_bytes, vir_bytes frame_len, int sep_id, - Dev_t st_dev, ino_t st_ino, time_t st_ctime, char *progname, + dev_t st_dev, ino_t st_ino, time_t st_ctime, char *progname, int new_uid, int new_gid, vir_bytes *stack_topp, int *load_textp, int *allow_setuidp) ); FORWARD _PROTOTYPE( int read_header, (struct vnode *vp, int *sep_id, @@ -200,25 +200,24 @@ vir_bytes frame_len; /*===========================================================================* * exec_newmem * *===========================================================================*/ -PRIVATE int exec_newmem(proc_e, text_bytes, data_bytes, bss_bytes, tot_bytes, - frame_len, sep_id, st_dev, st_ino, st_ctime, progname, - new_uid, new_gid, stack_topp, load_textp, allow_setuidp) -int proc_e; -vir_bytes text_bytes; -vir_bytes data_bytes; -vir_bytes bss_bytes; -vir_bytes tot_bytes; -vir_bytes frame_len; -int sep_id; -dev_t st_dev; -ino_t st_ino; -time_t st_ctime; -int new_uid; -int new_gid; -char *progname; -vir_bytes *stack_topp; -int *load_textp; -int *allow_setuidp; +PRIVATE int exec_newmem( + int proc_e, + vir_bytes text_bytes, + vir_bytes data_bytes, + vir_bytes bss_bytes, + vir_bytes tot_bytes, + vir_bytes frame_len, + int sep_id, + dev_t st_dev, + ino_t st_ino, + time_t st_ctime, + char *progname, + int new_uid, + int new_gid, + vir_bytes *stack_topp, + int *load_textp, + int *allow_setuidp +) { int r; struct exec_newmem e; diff --git a/servers/vfs/glo.h b/servers/vfs/glo.h index 3a56399fe..737f1c938 100644 --- a/servers/vfs/glo.h +++ b/servers/vfs/glo.h @@ -11,7 +11,7 @@ EXTERN int susp_count; /* number of procs suspended on pipe */ EXTERN int nr_locks; /* number of locks currently in place */ EXTERN int reviving; /* number of pipe processes to be revived */ -EXTERN Dev_t root_dev; /* device number of the root device */ +EXTERN dev_t root_dev; /* device number of the root device */ EXTERN int ROOT_FS_E; /* kernel endpoint of the root FS proc */ EXTERN int last_login_fs_e; /* endpoint of the FS proc that logged in before the corresponding mount request */ diff --git a/servers/vfs/mount.c b/servers/vfs/mount.c index 4a6dee940..6bf948dc5 100644 --- a/servers/vfs/mount.c +++ b/servers/vfs/mount.c @@ -40,7 +40,7 @@ PRIVATE bitchunk_t nonedev[BITMAP_CHUNKS(NR_NONEDEVS)] = { 0 }; FORWARD _PROTOTYPE( dev_t name_to_dev, (int allow_mountpt) ); FORWARD _PROTOTYPE( int mount_fs, (endpoint_t fs_e) ); -FORWARD _PROTOTYPE( int is_nonedev, (Dev_t dev) ); +FORWARD _PROTOTYPE( int is_nonedev, (dev_t dev) ); FORWARD _PROTOTYPE( dev_t find_free_nonedev, (void) ); /*===========================================================================* @@ -400,9 +400,10 @@ PUBLIC int do_umount() /*===========================================================================* * unmount * *===========================================================================*/ -PUBLIC int unmount(dev, label) -Dev_t dev; /* block-special device */ -char *label; /* buffer to retrieve label, or NULL */ +PUBLIC int unmount( + dev_t dev, /* block-special device */ + char *label /* buffer to retrieve label, or NULL */ +) { struct vnode *vp; struct vmnt *vmp_i = NULL, *vmp = NULL; @@ -519,7 +520,7 @@ int allow_mountpt; /*===========================================================================* * is_nonedev * *===========================================================================*/ -PRIVATE int is_nonedev(int dev) +PRIVATE int is_nonedev(dev_t dev) { /* Return whether the given device is a "none" pseudo device. */ diff --git a/servers/vfs/proto.h b/servers/vfs/proto.h index 295cff060..46eab94c4 100644 --- a/servers/vfs/proto.h +++ b/servers/vfs/proto.h @@ -11,19 +11,19 @@ struct vmnt; struct vnode; /* device.c */ -_PROTOTYPE( int dev_open, (Dev_t dev, int proc, int flags) ); -_PROTOTYPE( int dev_reopen, (Dev_t dev, int filp_no, int flags) ); -_PROTOTYPE( int dev_close, (Dev_t dev, int filp_no) ); -_PROTOTYPE( int dev_io, (int op, Dev_t dev, int proc, void *buf, +_PROTOTYPE( int dev_open, (dev_t dev, int proc, int flags) ); +_PROTOTYPE( int dev_reopen, (dev_t dev, int filp_no, int flags) ); +_PROTOTYPE( int dev_close, (dev_t dev, int filp_no) ); +_PROTOTYPE( int dev_io, (int op, dev_t dev, int proc, void *buf, u64_t pos, int bytes, int flags, int suspend_reopen) ); -_PROTOTYPE( int gen_opcl, (int op, Dev_t dev, int proc, int flags) ); +_PROTOTYPE( int gen_opcl, (int op, dev_t dev, int proc, int flags) ); _PROTOTYPE( int gen_io, (int task_nr, message *mess_ptr) ); _PROTOTYPE( int asyn_io, (int task_nr, message *mess_ptr) ); -_PROTOTYPE( int no_dev, (int op, Dev_t dev, int proc, int flags) ); +_PROTOTYPE( int no_dev, (int op, dev_t dev, int proc, int flags) ); _PROTOTYPE( int no_dev_io, (int, message *) ); -_PROTOTYPE( int tty_opcl, (int op, Dev_t dev, int proc, int flags) ); -_PROTOTYPE( int ctty_opcl, (int op, Dev_t dev, int proc, int flags) ); -_PROTOTYPE( int clone_opcl, (int op, Dev_t dev, int proc, int flags) ); +_PROTOTYPE( int tty_opcl, (int op, dev_t dev, int proc, int flags) ); +_PROTOTYPE( int ctty_opcl, (int op, dev_t dev, int proc, int flags) ); +_PROTOTYPE( int clone_opcl, (int op, dev_t dev, int proc, int flags) ); _PROTOTYPE( int ctty_io, (int task_nr, message *mess_ptr) ); _PROTOTYPE( int do_ioctl, (void) ); _PROTOTYPE( void pm_setsid, (int proc_e) ); @@ -37,7 +37,7 @@ _PROTOTYPE( void reopen_reply, (void) ); _PROTOTYPE( int do_mapdriver, (void) ); _PROTOTYPE( int map_service, (struct rprocpub *rpub) ); _PROTOTYPE( void build_dmap, (void) ); -_PROTOTYPE( int map_driver, (char *label, int major, int proc_nr, +_PROTOTYPE( int map_driver, (const char *label, int major, endpoint_t proc_nr, int dev_style, int flags) ); _PROTOTYPE( int dmap_driver_match, (endpoint_t proc, int major) ); _PROTOTYPE( void dmap_unmap_by_endpt, (int proc_nr) ); @@ -94,7 +94,7 @@ _PROTOTYPE( void ds_event, (void) ); _PROTOTYPE( int do_fslogin, (void) ); _PROTOTYPE( int do_mount, (void) ); _PROTOTYPE( int do_umount, (void) ); -_PROTOTYPE( int unmount, (Dev_t dev, char *label) ); +_PROTOTYPE( int unmount, (dev_t dev, char *label) ); /* open.c */ _PROTOTYPE( int do_close, (void) ); @@ -154,16 +154,16 @@ _PROTOTYPE( int rw_pipe, (int rw_flag, endpoint_t usr, /* request.c */ _PROTOTYPE( int req_breadwrite, (endpoint_t fs_e, endpoint_t user_e, - Dev_t dev, u64_t pos, unsigned int num_of_bytes, + dev_t dev, u64_t pos, unsigned int num_of_bytes, char *user_addr, int rw_flag, u64_t *new_posp, unsigned int *cum_iop) ); -_PROTOTYPE( int req_chmod, (int fs_e, ino_t inode_nr, _mnx_Mode_t rmode, +_PROTOTYPE( int req_chmod, (int fs_e, ino_t inode_nr, mode_t rmode, mode_t *new_modep) ); _PROTOTYPE( int req_chown, (endpoint_t fs_e, ino_t inode_nr, - _mnx_Uid_t newuid, _mnx_Gid_t newgid, mode_t *new_modep) ); + uid_t newuid, gid_t newgid, mode_t *new_modep) ); _PROTOTYPE( int req_create, (int fs_e, ino_t inode_nr, int omode, - int uid, int gid, char *path, node_details_t *res) ); -_PROTOTYPE( int req_flush, (endpoint_t fs_e, Dev_t dev) ); + uid_t uid, gid_t gid, char *path, node_details_t *res) ); +_PROTOTYPE( int req_flush, (endpoint_t fs_e, dev_t dev) ); _PROTOTYPE( int req_fstatfs, (int fs_e, int who_e, char *buf) ); _PROTOTYPE( int req_ftrunc, (endpoint_t fs_e, ino_t inode_nr, off_t start, off_t end) ); @@ -173,22 +173,22 @@ _PROTOTYPE( int req_inhibread, (endpoint_t fs_e, ino_t inode_nr) ); _PROTOTYPE( int req_link, (endpoint_t fs_e, ino_t link_parent, char *lastc, ino_t linked_file) ); _PROTOTYPE( int req_lookup, (endpoint_t fs_e, ino_t dir_ino, ino_t root_ino, - _mnx_Uid_t uid, _mnx_Gid_t gid, int flags, + uid_t uid, gid_t gid, int flags, lookup_res_t *res) ); _PROTOTYPE( int req_mkdir, (endpoint_t fs_e, ino_t inode_nr, - char *lastc, _mnx_Uid_t uid, _mnx_Gid_t gid, _mnx_Mode_t dmode) ); + char *lastc, uid_t uid, gid_t gid, mode_t dmode) ); _PROTOTYPE( int req_mknod, (endpoint_t fs_e, ino_t inode_nr, - char *lastc, _mnx_Uid_t uid, _mnx_Gid_t gid, - _mnx_Mode_t dmode, Dev_t dev) ); + char *lastc, uid_t uid, gid_t gid, + mode_t dmode, dev_t dev) ); _PROTOTYPE( int req_mountpoint, (endpoint_t fs_e, ino_t inode_nr) ); -_PROTOTYPE( int req_newnode, (endpoint_t fs_e, _mnx_Uid_t uid, - _mnx_Gid_t gid, _mnx_Mode_t dmode, - Dev_t dev, struct node_details *res) ); +_PROTOTYPE( int req_newnode, (endpoint_t fs_e, uid_t uid, + gid_t gid, mode_t dmode, + dev_t dev, struct node_details *res) ); _PROTOTYPE( int req_putnode, (int fs_e, ino_t inode_nr, int count) ); _PROTOTYPE( int req_rdlink, (endpoint_t fs_e, ino_t inode_nr, endpoint_t who_e, char *buf, size_t len) ); _PROTOTYPE( int req_readsuper, (endpoint_t fs_e, char *driver_name, - Dev_t dev, int readonly, int isroot, + dev_t dev, int readonly, int isroot, struct node_details *res_nodep) ); _PROTOTYPE( int req_readwrite, (endpoint_t fs_e, ino_t inode_nr, u64_t pos, int rw_flag, @@ -201,7 +201,7 @@ _PROTOTYPE( int req_rmdir, (endpoint_t fs_e, ino_t inode_nr, char *lastc) ); _PROTOTYPE(int req_slink, (endpoint_t fs_e, ino_t inode_nr, char *lastc, endpoint_t who_e, char *path_addr, - int path_length, _mnx_Uid_t uid, _mnx_Gid_t gid) ); + unsigned short path_length, uid_t uid, gid_t gid) ); _PROTOTYPE( int req_stat, (int fs_e, ino_t inode_nr, int who_e, char *buf, int pos) ); _PROTOTYPE( int req_sync, (endpoint_t fs_e) ); @@ -210,7 +210,7 @@ _PROTOTYPE( int req_unlink, (endpoint_t fs_e, ino_t inode_nr, _PROTOTYPE( int req_unmount, (endpoint_t fs_e) ); _PROTOTYPE( int req_utime, (endpoint_t fs_e, ino_t inode_nr, time_t actime, time_t modtime) ); -_PROTOTYPE( int req_newdriver, (endpoint_t fs_e, Dev_t dev, +_PROTOTYPE( int req_newdriver, (endpoint_t fs_e, dev_t dev, endpoint_t driver_e) ); /* stadir.c */ diff --git a/servers/vfs/request.c b/servers/vfs/request.c index 733bbdf1d..73e948c29 100644 --- a/servers/vfs/request.c +++ b/servers/vfs/request.c @@ -32,17 +32,17 @@ FORWARD _PROTOTYPE(int fs_sendrec_f, (char *file, int line, endpoint_t fs_e, /*===========================================================================* * req_breadwrite * *===========================================================================*/ -PUBLIC int req_breadwrite(fs_e, user_e, dev, pos, num_of_bytes, user_addr, - rw_flag, new_posp, cum_iop) -endpoint_t fs_e; -endpoint_t user_e; -dev_t dev; -u64_t pos; -unsigned int num_of_bytes; -char *user_addr; -int rw_flag; -u64_t *new_posp; -unsigned int *cum_iop; +PUBLIC int req_breadwrite( + endpoint_t fs_e, + endpoint_t user_e, + dev_t dev, + u64_t pos, + unsigned int num_of_bytes, + char *user_addr, + int rw_flag, + u64_t *new_posp, + unsigned int *cum_iop +) { int r; cp_grant_id_t grant_id; @@ -77,11 +77,12 @@ unsigned int *cum_iop; /*===========================================================================* * req_chmod * *===========================================================================*/ -PUBLIC int req_chmod(fs_e, inode_nr, rmode, new_modep) -int fs_e; -ino_t inode_nr; -mode_t rmode; -mode_t *new_modep; +PUBLIC int req_chmod( + int fs_e, + ino_t inode_nr, + mode_t rmode, + mode_t *new_modep +) { message m; int r; @@ -104,12 +105,13 @@ mode_t *new_modep; /*===========================================================================* * req_chown * *===========================================================================*/ -PUBLIC int req_chown(fs_e, inode_nr, newuid, newgid, new_modep) -endpoint_t fs_e; -ino_t inode_nr; -uid_t newuid; -gid_t newgid; -mode_t *new_modep; +PUBLIC int req_chown( + endpoint_t fs_e, + ino_t inode_nr, + uid_t newuid, + gid_t newgid, + mode_t *new_modep +) { message m; int r; @@ -133,14 +135,15 @@ mode_t *new_modep; /*===========================================================================* * req_create * *===========================================================================*/ -int req_create(fs_e, inode_nr, omode, uid, gid, path, res) -int fs_e; -ino_t inode_nr; -int omode; -uid_t uid; -gid_t gid; -char *path; -node_details_t *res; +int req_create( + int fs_e, + ino_t inode_nr, + int omode, + uid_t uid, + gid_t gid, + char *path, + node_details_t *res +) { int r; cp_grant_id_t grant_id; @@ -185,9 +188,7 @@ node_details_t *res; /*===========================================================================* * req_flush * *===========================================================================*/ -PUBLIC int req_flush(fs_e, dev) -endpoint_t fs_e; -dev_t dev; +PUBLIC int req_flush(endpoint_t fs_e, dev_t dev) { message m; @@ -346,14 +347,15 @@ ino_t linked_file; /*===========================================================================* * req_lookup * *===========================================================================*/ -PUBLIC int req_lookup(fs_e, dir_ino, root_ino, uid, gid, flags, res) -endpoint_t fs_e; -ino_t dir_ino; -ino_t root_ino; -uid_t uid; -gid_t gid; -int flags; -lookup_res_t *res; +PUBLIC int req_lookup( + endpoint_t fs_e, + ino_t dir_ino, + ino_t root_ino, + uid_t uid, + gid_t gid, + int flags, + lookup_res_t *res +) { int r; size_t len; @@ -444,13 +446,14 @@ lookup_res_t *res; /*===========================================================================* * req_mkdir * *===========================================================================*/ -PUBLIC int req_mkdir(fs_e, inode_nr, lastc, uid, gid, dmode) -endpoint_t fs_e; -ino_t inode_nr; -char *lastc; -uid_t uid; -gid_t gid; -mode_t dmode; +PUBLIC int req_mkdir( + endpoint_t fs_e, + ino_t inode_nr, + char *lastc, + uid_t uid, + gid_t gid, + mode_t dmode +) { int r; cp_grant_id_t grant_id; @@ -482,14 +485,15 @@ mode_t dmode; /*===========================================================================* * req_mknod * *===========================================================================*/ -PUBLIC int req_mknod(fs_e, inode_nr, lastc, uid, gid, dmode, dev) -endpoint_t fs_e; -ino_t inode_nr; -char *lastc; -uid_t uid; -gid_t gid; -mode_t dmode; -dev_t dev; +PUBLIC int req_mknod( + endpoint_t fs_e, + ino_t inode_nr, + char *lastc, + uid_t uid, + gid_t gid, + mode_t dmode, + dev_t dev +) { int r; size_t len; @@ -540,13 +544,14 @@ ino_t inode_nr; /*===========================================================================* * req_newnode * *===========================================================================*/ -PUBLIC int req_newnode(fs_e, uid, gid, dmode, dev, res) -endpoint_t fs_e; -uid_t uid; -gid_t gid; -mode_t dmode; -dev_t dev; -struct node_details *res; +PUBLIC int req_newnode( + endpoint_t fs_e, + uid_t uid, + gid_t gid, + mode_t dmode, + dev_t dev, + struct node_details *res +) { int r; message m; @@ -576,10 +581,11 @@ struct node_details *res; /*===========================================================================* * req_newdriver * *===========================================================================*/ -PUBLIC int req_newdriver(fs_e, dev, driver_e) -endpoint_t fs_e; -Dev_t dev; -endpoint_t driver_e; +PUBLIC int req_newdriver( + endpoint_t fs_e, + dev_t dev, + endpoint_t driver_e +) { /* Note: this is the only request function that doesn't use the * fs_sendrec internal routine, since we want to avoid the dead @@ -664,13 +670,14 @@ size_t len; /*===========================================================================* * req_readsuper * *===========================================================================*/ -PUBLIC int req_readsuper(fs_e, label, dev, readonly, isroot, res_nodep) -endpoint_t fs_e; -char *label; -dev_t dev; -int readonly; -int isroot; -struct node_details *res_nodep; +PUBLIC int req_readsuper( + endpoint_t fs_e, + char *label, + dev_t dev, + int readonly, + int isroot, + struct node_details *res_nodep +) { int r; cp_grant_id_t grant_id; @@ -836,16 +843,16 @@ char *lastc; /*===========================================================================* * req_slink * *===========================================================================*/ -PUBLIC int req_slink(fs_e, inode_nr, lastc, who_e, path_addr, path_length, - uid, gid) -endpoint_t fs_e; -ino_t inode_nr; -char *lastc; -endpoint_t who_e; -char *path_addr; -unsigned short path_length; -uid_t uid; -gid_t gid; +PUBLIC int req_slink( + endpoint_t fs_e, + ino_t inode_nr, + char *lastc, + endpoint_t who_e, + char *path_addr, + unsigned short path_length, + uid_t uid, + gid_t gid +) { int r; size_t len; diff --git a/servers/vm/exec.c b/servers/vm/exec.c index 7c8465f63..ba0a534ec 100644 --- a/servers/vm/exec.c +++ b/servers/vm/exec.c @@ -39,11 +39,12 @@ static int failcount; /*===========================================================================* * find_share * *===========================================================================*/ -PUBLIC struct vmproc *find_share(vmp_ign, ino, dev, ctime) -struct vmproc *vmp_ign; /* process that should not be looked at */ -ino_t ino; /* parameters that uniquely identify a file */ -dev_t dev; -time_t ctime; +PUBLIC struct vmproc *find_share( + struct vmproc *vmp_ign, /* process that should not be looked at */ + ino_t ino, /* parameters that uniquely identify a file */ + dev_t dev, + time_t ctime +) { /* Look for a process that is the file in execution. Don't * accidentally "find" vmp_ign, because it is the process on whose behalf this diff --git a/servers/vm/proto.h b/servers/vm/proto.h index 1b3535664..b3ce87331 100644 --- a/servers/vm/proto.h +++ b/servers/vm/proto.h @@ -56,7 +56,7 @@ _PROTOTYPE( int do_fork, (message *msg) ); /* exec.c */ _PROTOTYPE( struct vmproc *find_share, (struct vmproc *vmp_ign, Ino_t ino, - Dev_t dev, time_t ctime) ); + dev_t dev, time_t ctime) ); _PROTOTYPE( int do_exec_newmem, (message *msg) ); _PROTOTYPE( int proc_new, (struct vmproc *vmp, phys_bytes start, phys_bytes text, phys_bytes data, phys_bytes stack, phys_bytes gap,