Use ANSI-style function declarations where necessary.
#include <sys/stat.h>
#include <pwd.h>
#endif
-extern struct passwd *getpwuid();
/* This variable is used to add extra error messages for mail sent to root */
char *ps;
#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 ));
* 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;
(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);
_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 */
* 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;
* 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;
_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));
/* 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);
}
/* 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;
}
/* 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;
* 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")) {
}
/* 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];
}
/* 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;
/* 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 ");
/* 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;
}
-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;
/* 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;
/* 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 &&
}
/* 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;
}
/* 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;
}
/* 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;
#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;
#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;
}
/* 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:
}
/* 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 ");
};
/* 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, ...) );
};
/* 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
* 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;
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 */
/* 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) );
#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) );
_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) );
_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) );
_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) );
/*===========================================================================*
* 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. */
/*===========================================================================*
* 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;
}
}
-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;
}
}
-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;
#define chmod _chmod
#include <sys/stat.h>
-PUBLIC int chmod(name, mode)
-_CONST char *name;
-_mnx_Mode_t mode;
+PUBLIC int chmod(const char *name, mode_t mode)
{
message m;
#include <string.h>
#include <unistd.h>
-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;
#define creat _creat
#include <fcntl.h>
-PUBLIC int creat(name, mode)
-_CONST char *name;
-_mnx_Mode_t mode;
+PUBLIC int creat(const char *name, mode_t mode)
{
message m;
#define fchmod _fchmod
#include <sys/stat.h>
-PUBLIC int fchmod(fd, mode)
-int fd;
-_mnx_Mode_t mode;
+PUBLIC int fchmod(int fd, mode_t mode)
{
message m;
#include <string.h>
#include <unistd.h>
-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;
#include <sys/stat.h>
#include <string.h>
-PUBLIC int mkdir(name, mode)
-_CONST char *name;
-_mnx_Mode_t mode;
+PUBLIC int mkdir(const char *name, mode_t mode)
{
message m;
#include <sys/stat.h>
#include <unistd.h>
-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);
}
#include <stdlib.h>
#include <unistd.h>
-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;
#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;
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);
#define setegid _setegid
#include <unistd.h>
-PUBLIC int setgid(grp)
-gid_t grp;
+PUBLIC int setgid(gid_t grp)
{
message m;
return(_syscall(MM, SETGID, &m));
}
-PUBLIC int setegid(grp)
-gid_t grp;
+PUBLIC int setegid(gid_t grp)
{
message m;
#define seteuid _seteuid
#include <unistd.h>
-PUBLIC int setuid(usr)
-_mnx_Uid_t usr;
+PUBLIC int setuid(uid_t usr)
{
message m;
return(_syscall(MM, SETUID, &m));
}
-PUBLIC int seteuid(usr)
-_mnx_Uid_t usr;
+PUBLIC int seteuid(uid_t usr)
{
message m;
#define umask _umask
#include <sys/stat.h>
-PUBLIC mode_t umask(complmode)
-_mnx_Mode_t complmode;
+PUBLIC mode_t umask(mode_t complmode)
{
message m;
#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 *
#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 *
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));
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
_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) );
/* 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) );
/* 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;
/*===========================================================================*
* 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
/*===========================================================================*
* 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. */
/*===========================================================================*
* 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. */
/*===========================================================================*
* 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. */
/*===========================================================================*
* 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. */
/*===========================================================================*
* 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. */
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) );
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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);
}
/*===========================================================================*
* 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;
/*===========================================================================*
* fs_putnode *
*===========================================================================*/
-PUBLIC int fs_putnode()
+PUBLIC int fs_putnode(void)
{
/* Find the inode specified by the request message and decrease its counter.*/
/*===========================================================================*
* 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
/*===========================================================================*
* 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.
*/
/*===========================================================================*
* 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. */
/* 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) );
_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) );
/*===========================================================================*
* 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");
/*===========================================================================*
* 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++;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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
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) );
_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) );
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) );
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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. */
/*===========================================================================*
* 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.
/*===========================================================================*
* 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);
/*===========================================================================*
* 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
* 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 */
*/
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];
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,
/*===========================================================================*
* 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;
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 */
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) );
/*===========================================================================*
/*===========================================================================*
* 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;
/*===========================================================================*
* 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.
*/
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) );
_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) );
_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) );
/* 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) );
_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,
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) );
_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 */
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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
/*===========================================================================*
* 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;
/*===========================================================================*
* 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;
/*===========================================================================*
* 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 <ino, dev, ctime> in execution. Don't
* accidentally "find" vmp_ign, because it is the process on whose behalf this
/* 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,