More space for synctree.
#endif
#ifdef OS_Minix
-typedef unsigned char *caddr_t;
+/* typedef unsigned char *caddr_t; */
#endif
synctree: synctree.c
$(CCLD) -o $@ -wo $?
- @install -S 32kw $@
+ install -S 64kw $@
sysenv: sysenv.c
$(CCLD) -o $@ -wo $?
char path[PATH_MAX + 1];
_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(mode_t parsemode, (char *symbolic, Mode_t oldmode));
+_PROTOTYPE(mode_t parsemode, (char *symbolic, mode_t oldmode));
_PROTOTYPE(int do_change, (char *name));
_PROTOTYPE(void usage, (void));
/* Parse a P1003.2 4.7.7-conformant symbolic mode. */
-mode_t parsemode(symbolic, oldmode)
-char *symbolic;
-mode_t oldmode;
+mode_t parsemode(char *symbolic, mode_t oldmode)
{
mode_t who, mask, newmode, tmpmask;
char action;
*-----------------------------------------------------------------------------
*/
+#include <errno.h>
#include <stdlib.h>
#include <limits.h> /* NAME_MAX for maximal filename length */
#include <string.h> /* string manipulation */
inputfp = popen(buff, "r");
if (!inputfp) {
- fprintf(stderr, "Can't execute diff %s %s\n", old, new);
+ fprintf(stderr, "Can't execute diff %s %s, popen failed with %s\n",
+ old, new, strerror(errno));
exit(2);
}
preoldend = -1000;
prenewend = newend;
}
}
+ fprintf(stderr, "pipe fd is %d\n", fileno(inputfp));
status = pclose(inputfp);
if (status != 0) diffs++;
if (!WIFEXITED(status) || WEXITSTATUS(status) > 1) severe_error = 1;
_PROTOTYPE(void counterror, (Ino_t ino));
_PROTOTYPE(void chkcount, (void));
_PROTOTYPE(void freecount, (void));
-_PROTOTYPE(void printperm, (Mode_t mode, int shift, int special, int overlay));
+_PROTOTYPE(void printperm, (mode_t mode, int shift, int special, int overlay));
_PROTOTYPE(void list, (Ino_t ino, d_inode *ip));
_PROTOTYPE(int Remove, (dir_struct *dp));
_PROTOTYPE(void make_printable_name, (char *dst, char *src, int n));
}
/* Print the inode permission bits given by mode and shift. */
-void printperm(mode, shift, special, overlay)
-mode_t mode;
-int shift;
-int special;
-int overlay;
+void printperm(mode_t mode, int shift, int special, int overlay)
{
if (mode >> shift & R_BIT)
putchar('r');
_PROTOTYPE(void counterror, (Ino_t ino));
_PROTOTYPE(void chkcount, (void));
_PROTOTYPE(void freecount, (void));
-_PROTOTYPE(void printperm, (Mode_t mode, int shift, int special, int overlay));
+_PROTOTYPE(void printperm, (mode_t mode, int shift, int special, int overlay));
_PROTOTYPE(void list, (Ino_t ino, d_inode *ip));
_PROTOTYPE(int Remove, (dir_struct *dp));
_PROTOTYPE(void make_printable_name, (char *dst, char *src, int n));
}
/* Print the inode permission bits given by mode and shift. */
-void printperm(mode, shift, special, overlay)
-mode_t mode;
-int shift;
-int special;
-int overlay;
+void printperm(mode_t mode, int shift, int special, int overlay)
{
if (mode >> shift & R_BIT)
putchar('r');
struct stat st;
_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(mode_t parsemode, (char *symbolic, Mode_t oldmode));
+_PROTOTYPE(mode_t parsemode, (char *symbolic, mode_t oldmode));
_PROTOTYPE(int makepath, (char *fordir));
_PROTOTYPE(int makedir, (char *dirname));
_PROTOTYPE(void usage, (void));
/* Parse a P1003.2 4.7.7-conformant symbolic mode. */
-mode_t parsemode(symbolic, oldmode)
-char *symbolic;
-mode_t oldmode;
+mode_t parsemode(char *symbolic, mode_t oldmode)
{
mode_t who, mask, newmode, tmpmask;
char action;
mode_t u_mask;
_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(mode_t parsemode, (char *symbolic, Mode_t oldmode));
+_PROTOTYPE(mode_t parsemode, (char *symbolic, mode_t oldmode));
_PROTOTYPE(void usage, (void));
/* Parse a P1003.2 4.7.7-conformant symbolic mode. */
-mode_t parsemode(symbolic, oldmode)
-char *symbolic;
-mode_t oldmode;
+mode_t parsemode(char *symbolic, mode_t oldmode)
{
mode_t who, mask, newmode, tmpmask;
char action;
/* Function Prototypes. */
-_PROTOTYPE( int creat, (const char *_path, Mode_t _mode) );
+_PROTOTYPE( int creat, (const char *_path, _mnx_Mode_t _mode) );
_PROTOTYPE( int fcntl, (int _filedes, int _cmd, ...) );
_PROTOTYPE( int open, (const char *_path, int _oflag, ...) );
};
/* Function Prototypes. */
-_PROTOTYPE( struct group *getgrgid, (Gid_t _gid) );
+_PROTOTYPE( struct group *getgrgid, (_mnx_Gid_t _gid) );
_PROTOTYPE( struct group *getgrnam, (const char *_name) );
#ifdef _MINIX
/* Function Prototypes. */
_PROTOTYPE( struct passwd *getpwnam, (const char *_name) );
-_PROTOTYPE( struct passwd *getpwuid, (Uid_t _uid) );
+_PROTOTYPE( struct passwd *getpwuid, (_mnx_Uid_t _uid) );
#ifdef _MINIX
_PROTOTYPE( void endpwent, (void) );
#ifndef _MINIX__TYPES_H
#include <sys/types.h>
#endif
+#include <minix/config.h>
#if (_WORD_SIZE != 2 && _WORD_SIZE != 4) || \
(_PTR_SIZE != _WORD_SIZE && _PTR_SIZE != 2*_WORD_SIZE)
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* is a sym link */
/* Function Prototypes. */
-_PROTOTYPE( int chmod, (const char *_path, Mode_t _mode) );
+_PROTOTYPE( int chmod, (const char *_path, _mnx_Mode_t _mode) );
_PROTOTYPE( int fstat, (int _fildes, struct stat *_buf) );
-_PROTOTYPE( int mkdir, (const char *_path, Mode_t _mode) );
-_PROTOTYPE( int mkfifo, (const char *_path, Mode_t _mode) );
+_PROTOTYPE( int mkdir, (const char *_path, _mnx_Mode_t _mode) );
+_PROTOTYPE( int mkfifo, (const char *_path, _mnx_Mode_t _mode) );
_PROTOTYPE( int stat, (const char *_path, struct stat *_buf) );
-_PROTOTYPE( mode_t umask, (Mode_t _cmask) );
+_PROTOTYPE( mode_t umask, (_mnx_Mode_t _cmask) );
/* Open Group Base Specifications Issue 6 (not complete) */
_PROTOTYPE( int lstat, (const char *_path, struct stat *_buf) );
* is clearer.
*/
typedef int Dev_t;
-typedef int Gid_t;
+typedef int _mnx_Gid_t;
typedef int Nlink_t;
-typedef int Uid_t;
+typedef int _mnx_Uid_t;
typedef int U8_t;
typedef unsigned long U32_t;
typedef int I8_t;
typedef unsigned int Zone1_t;
typedef unsigned int Bitchunk_t;
typedef unsigned int U16_t;
-typedef unsigned int Mode_t;
+typedef unsigned int _mnx_Mode_t;
#else /* _EM_WSIZE == 4, or _EM_WSIZE undefined */
/*typedef int Ino_t; Ino_t is now 32 bits */
typedef int Zone1_t;
typedef int Bitchunk_t;
typedef int U16_t;
-typedef int Mode_t;
+typedef int _mnx_Mode_t;
#endif /* _EM_WSIZE == 2, etc */
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
+typedef char *caddr_t;
#endif /* _TYPES_H */
_PROTOTYPE( int access, (const char *_path, int _amode) );
_PROTOTYPE( unsigned int alarm, (unsigned int _seconds) );
_PROTOTYPE( int chdir, (const char *_path) );
-_PROTOTYPE( int chown, (const char *_path, Uid_t _owner, Gid_t _group) );
+_PROTOTYPE( int chown, (const char *_path, _mnx_Uid_t _owner, _mnx_Gid_t _group) );
_PROTOTYPE( int close, (int _fd) );
_PROTOTYPE( char *ctermid, (char *_s) );
_PROTOTYPE( char *cuserid, (char *_s) );
_PROTOTYPE( int pipe, (int _fildes[2]) );
_PROTOTYPE( ssize_t read, (int _fd, void *_buf, size_t _n) );
_PROTOTYPE( int rmdir, (const char *_path) );
-_PROTOTYPE( int setgid, (Gid_t _gid) );
+_PROTOTYPE( int setgid, (_mnx_Gid_t _gid) );
_PROTOTYPE( int setpgid, (pid_t _pid, pid_t _pgid) );
_PROTOTYPE( pid_t setsid, (void) );
-_PROTOTYPE( int setuid, (Uid_t _uid) );
+_PROTOTYPE( int setuid, (_mnx_Uid_t _uid) );
_PROTOTYPE( unsigned int sleep, (unsigned int _seconds) );
_PROTOTYPE( long sysconf, (int _name) );
_PROTOTYPE( pid_t tcgetpgrp, (int _fd) );
#endif
_PROTOTYPE( int brk, (char *_addr) );
_PROTOTYPE( int chroot, (const char *_name) );
-_PROTOTYPE( int mknod, (const char *_name, Mode_t _mode, Dev_t _addr) );
-_PROTOTYPE( int mknod4, (const char *_name, Mode_t _mode, Dev_t _addr,
+_PROTOTYPE( int mknod, (const char *_name, _mnx_Mode_t _mode, Dev_t _addr) );
+_PROTOTYPE( int mknod4, (const char *_name, _mnx_Mode_t _mode, Dev_t _addr,
long _size) );
_PROTOTYPE( char *mktemp, (char *_template) );
_PROTOTYPE( int mount, (char *_spec, char *_name, int _flag) );
}
}
-struct group *getgrgid(Gid_t gid)
+struct group *getgrgid(_mnx_Gid_t gid)
/* Return the group file entry belonging to the user-id. */
{
struct group *gr;
}
}
-struct passwd *getpwuid(Uid_t uid)
+struct passwd *getpwuid(_mnx_Uid_t uid)
/* Return the password file entry belonging to the user-id. */
{
struct passwd *pw;
PUBLIC int chmod(name, mode)
_CONST char *name;
-Mode_t mode;
+_mnx_Mode_t mode;
{
message m;
PUBLIC int chown(name, owner, grp)
_CONST char *name;
-Uid_t owner;
-Gid_t grp;
+_mnx_Uid_t owner;
+_mnx_Gid_t grp;
{
message m;
PUBLIC int creat(name, mode)
_CONST char *name;
-Mode_t mode;
+_mnx_Mode_t mode;
{
message m;
PUBLIC int mkdir(name, mode)
_CONST char *name;
-Mode_t mode;
+_mnx_Mode_t mode;
{
message m;
PUBLIC int mkfifo(name, mode)
_CONST char *name;
-Mode_t mode;
+_mnx_Mode_t mode;
{
return mknod(name, mode | S_IFIFO, (Dev_t) 0);
}
PUBLIC int mknod(name, mode, dev)
_CONST char *name;
-Mode_t mode;
+_mnx_Mode_t mode;
Dev_t dev;
{
message m;
if (flags & O_CREAT) {
m.m1_i1 = strlen(name) + 1;
m.m1_i2 = flags;
- m.m1_i3 = va_arg(argp, Mode_t);
+ m.m1_i3 = va_arg(argp, _mnx_Mode_t);
m.m1_p1 = (char *) name;
} else {
_loadname(name, &m);
#include <unistd.h>
PUBLIC int setuid(usr)
-Uid_t usr;
+_mnx_Uid_t usr;
{
message m;
#include <sys/stat.h>
PUBLIC mode_t umask(complmode)
-Mode_t complmode;
+_mnx_Mode_t complmode;
{
message m;
#define O_APPEND 0x040
int _open(const char *path, int flags);
-int _creat(const char *path, Mode_t mode);
+int _creat(const char *path, _mnx_Mode_t mode);
int _close(int d);
FILE *
#define O_APPEND 0x040
int _open(const char *path, int flags);
-int _creat(const char *path, Mode_t mode);
+int _creat(const char *path, _mnx_Mode_t mode);
int _close(int d);
FILE *
/*===========================================================================*
* get_fd *
*===========================================================================*/
-PUBLIC int get_fd(start, bits, k, fpt)
-int start; /* start of search (used for F_DUPFD) */
-mode_t bits; /* mode of the file to be created (RWX bits) */
-int *k; /* place to return file descriptor */
-struct filp **fpt; /* place to return filp slot */
+PUBLIC int get_fd(int start, mode_t bits, int *k, struct filp **fpt)
{
/* Look for a free file descriptor and a free filp slot. Fill in the mode word
* in the latter, but don't claim either one yet, since the open() or creat()
/*===========================================================================*
* find_filp *
*===========================================================================*/
-PUBLIC struct filp *find_filp(rip, bits)
-register struct inode *rip; /* inode referred to by the filp to be found */
-Mode_t bits; /* mode of the filp to be found (RWX bits) */
+PUBLIC struct filp *find_filp(register struct inode *rip, mode_t bits)
{
/* Find a filp slot that refers to the inode 'rip' in a way as described
* by the mode bit 'bits'. Used for determining whether somebody is still
/*===========================================================================*
* alloc_inode *
*===========================================================================*/
-PUBLIC struct inode *alloc_inode(dev, bits)
-dev_t dev; /* device on which to allocate the inode */
-mode_t bits; /* mode of the inode */
+PUBLIC struct inode *alloc_inode(dev_t dev, mode_t bits)
{
/* Allocate a free inode on 'dev', and return a pointer to it. */
PRIVATE char mode_map[] = {R_BIT, W_BIT, R_BIT|W_BIT, 0};
-FORWARD _PROTOTYPE( int common_open, (int oflags, Mode_t omode) );
-FORWARD _PROTOTYPE( int pipe_open, (struct inode *rip,Mode_t bits,int oflags));
-FORWARD _PROTOTYPE( struct inode *new_node, (char *path, Mode_t bits,
+FORWARD _PROTOTYPE( int common_open, (int oflags, mode_t omode) );
+FORWARD _PROTOTYPE( int pipe_open, (struct inode *rip,mode_t bits,int oflags));
+FORWARD _PROTOTYPE( struct inode *new_node, (char *path, mode_t bits,
zone_t z0) );
/*===========================================================================*
* common_open *
*===========================================================================*/
-PRIVATE int common_open(oflags, omode)
-register int oflags;
-mode_t omode;
+PRIVATE int common_open(register int oflags, mode_t omode)
{
/* Common code from do_creat and do_open. */
/*===========================================================================*
* new_node *
*===========================================================================*/
-PRIVATE struct inode *new_node(path, bits, z0)
-char *path; /* pointer to path name */
-mode_t bits; /* mode of the new inode */
-zone_t z0; /* zone number 0 for new inode */
+PRIVATE struct inode *new_node(char *path, mode_t bits, zone_t z0)
{
/* New_node() is called by common_open(), do_mknod(), and do_mkdir().
* In all cases it allocates a new inode, makes a directory entry for it on
/*===========================================================================*
* pipe_open *
*===========================================================================*/
-PRIVATE int pipe_open(rip, bits, oflags)
-register struct inode *rip;
-register mode_t bits;
-register int oflags;
+PRIVATE int pipe_open(register struct inode *rip, register mode_t bits,
+ register int oflags)
{
/* This function is called from common_open. It checks if
* there is at least one reader/writer pair for the pipe, if not
/*===========================================================================*
* forbidden *
*===========================================================================*/
-PUBLIC int forbidden(rip, access_desired)
-register struct inode *rip; /* pointer to inode to be checked */
-mode_t access_desired; /* RWX bits */
+PUBLIC int forbidden(register struct inode *rip, mode_t access_desired)
{
/* Given a pointer to an inode, 'rip', and the access desired, determine
* if the access is allowed, and if not why not. The routine looks up the
_PROTOTYPE( int map_driver, (int major, int proc_nr, int dev_style) );
/* filedes.c */
-_PROTOTYPE( struct filp *find_filp, (struct inode *rip, Mode_t bits) );
-_PROTOTYPE( int get_fd, (int start, Mode_t bits, int *k, struct filp **fpt) );
+_PROTOTYPE( struct filp *find_filp, (struct inode *rip, mode_t bits) );
+_PROTOTYPE( int get_fd, (int start, mode_t bits, int *k, struct filp **fpt) );
_PROTOTYPE( struct filp *get_filp, (int fild) );
/* inode.c */
-_PROTOTYPE( struct inode *alloc_inode, (Dev_t dev, Mode_t bits) );
+_PROTOTYPE( struct inode *alloc_inode, (dev_t dev, mode_t bits) );
_PROTOTYPE( void dup_inode, (struct inode *ip) );
_PROTOTYPE( void free_inode, (Dev_t dev, Ino_t numb) );
_PROTOTYPE( struct inode *get_inode, (Dev_t dev, int numb) );
_PROTOTYPE( int do_chmod, (void) );
_PROTOTYPE( int do_chown, (void) );
_PROTOTYPE( int do_umask, (void) );
-_PROTOTYPE( int forbidden, (struct inode *rip, Mode_t access_desired) );
+_PROTOTYPE( int forbidden, (struct inode *rip, mode_t access_desired) );
_PROTOTYPE( int read_only, (struct inode *ip) );
/* read.c */