Updates and fixes
This commit is contained in:
		
							parent
							
								
									4bd8dcde59
								
							
						
					
					
						commit
						1df45b5beb
					
				
					 7 changed files with 25 additions and 18 deletions
				
			
		|  | @ -32,7 +32,6 @@ mkdir.s | ||||||
| mkfifo.s | mkfifo.s | ||||||
| mknod.s | mknod.s | ||||||
| mknod4.s | mknod4.s | ||||||
| mktemp.s |  | ||||||
| mount.s | mount.s | ||||||
| open.s | open.s | ||||||
| pause.s | pause.s | ||||||
|  | @ -93,7 +92,6 @@ _mkdir.c | ||||||
| _mkfifo.c | _mkfifo.c | ||||||
| _mknod.c | _mknod.c | ||||||
| _mknod4.c | _mknod4.c | ||||||
| _mktemp.c |  | ||||||
| _mount.c | _mount.c | ||||||
| _open.c | _open.c | ||||||
| pathconf.c | pathconf.c | ||||||
|  |  | ||||||
|  | @ -1,10 +1,9 @@ | ||||||
| #include <lib.h> | #include <lib.h> | ||||||
| #include <string.h> | #include <unistd.h> | ||||||
| #define execl	_execl | #define execl	_execl | ||||||
| #define execle	_execle | #define execle	_execle | ||||||
| #define execv	_execv | #define execv	_execv | ||||||
| #define execve	_execve | #define execve	_execve | ||||||
| #include <unistd.h> |  | ||||||
| 
 | 
 | ||||||
| extern char **environ;		/* environment pointer */ | extern char **environ;		/* environment pointer */ | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,21 +1,32 @@ | ||||||
| #include <lib.h> | #include <lib.h> | ||||||
| #define fcntl _fcntl | #define fcntl _fcntl | ||||||
| #include <fcntl.h> | #include <fcntl.h> | ||||||
| #include <stdarg.h> | #if _ANSI | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
| #if _ANSI | #if _ANSI | ||||||
|  | #include <stdarg.h> | ||||||
| PUBLIC int fcntl(int fd, int cmd, ...) | PUBLIC int fcntl(int fd, int cmd, ...) | ||||||
|  | { | ||||||
| #else | #else | ||||||
| PUBLIC int fcntl(fd, cmd) | #include <varargs.h> | ||||||
|  | PUBLIC int fcntl(va_alist) | ||||||
|  | va_dcl | ||||||
|  | { | ||||||
| int fd; | int fd; | ||||||
| int cmd; | int cmd; | ||||||
| #endif | #endif | ||||||
| { |   va_list ap; | ||||||
|   va_list argp; |  | ||||||
|   int int3;			/* third integer parameter for callm1 */ |   int int3;			/* third integer parameter for callm1 */ | ||||||
|   char *ptr1;			/* first pointer parameter for callm1 */ |   char *ptr1;			/* first pointer parameter for callm1 */ | ||||||
| 
 | 
 | ||||||
|   va_start(argp, cmd); | #if _ANSI | ||||||
|  |   va_start(ap, cmd); | ||||||
|  | #else | ||||||
|  |   va_start(ap); | ||||||
|  |   fd = va_arg(ap, int); | ||||||
|  |   cmd = va_arg(ap, int); | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
|   /* Set up for the sensible case where there is no variable parameter.  This
 |   /* Set up for the sensible case where there is no variable parameter.  This
 | ||||||
|    * covers F_GETFD, F_GETFL and invalid commands. |    * covers F_GETFD, F_GETFL and invalid commands. | ||||||
|  | @ -28,16 +39,16 @@ int cmd; | ||||||
|      case F_DUPFD: |      case F_DUPFD: | ||||||
|      case F_SETFD: |      case F_SETFD: | ||||||
|      case F_SETFL: |      case F_SETFL: | ||||||
| 	int3 = va_arg(argp, int); | 	int3 = va_arg(ap, int); | ||||||
| 	break; | 	break; | ||||||
|      case F_GETLK: |      case F_GETLK: | ||||||
|      case F_SETLK: |      case F_SETLK: | ||||||
|      case F_SETLKW: |      case F_SETLKW: | ||||||
| 	ptr1 = (char *) va_arg(argp, struct flock *); | 	ptr1 = (char *) va_arg(ap, struct flock *); | ||||||
| 	break; | 	break; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /* Clean up and make the system call. */   |   /* Clean up and make the system call. */   | ||||||
|   va_end(argp);	 |   va_end(ap);	 | ||||||
|   return(_callm1(FS, FCNTL, fd, cmd, int3, ptr1, NIL_PTR, NIL_PTR)); |   return(_callm1(FS, FCNTL, fd, cmd, int3, ptr1, NIL_PTR, NIL_PTR)); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -8,13 +8,12 @@ | ||||||
| #include <sys/stat.h> | #include <sys/stat.h> | ||||||
| #include <fcntl.h> | #include <fcntl.h> | ||||||
| #include <sys/dir.h> | #include <sys/dir.h> | ||||||
| #define getcwd	_getcwd |  | ||||||
| #include <unistd.h> |  | ||||||
| #include <string.h> | #include <string.h> | ||||||
|  | #define getcwd	_getcwd | ||||||
| 
 | 
 | ||||||
| #define  DIRECT_SIZE  (sizeof (struct direct)) | #define  DIRECT_SIZE  (sizeof (struct direct)) | ||||||
| 
 | 
 | ||||||
| PRIVATE _PROTOTYPE(void,  go_back(char *path) ); | PRIVATE _PROTOTYPE(void  go_back, (char *path) ); | ||||||
| 
 | 
 | ||||||
| char *getcwd(buffer, size) | char *getcwd(buffer, size) | ||||||
| char *buffer; | char *buffer; | ||||||
|  |  | ||||||
|  | @ -1,12 +1,13 @@ | ||||||
| /* _utime(2) for POSIX		Authors: Terrence W. Holm & Edwin L. Froese */ | /* _utime(2) for POSIX		Authors: Terrence W. Holm & Edwin L. Froese */ | ||||||
| 
 | 
 | ||||||
| #include <lib.h> | #include <lib.h> | ||||||
| #include <stddef.h> |  | ||||||
| #define time	_time | #define time	_time | ||||||
| #include <time.h> | #include <time.h> | ||||||
| #define utime	_utime | #define utime	_utime | ||||||
| #include <utime.h> | #include <utime.h> | ||||||
| 
 | 
 | ||||||
|  | long time(); | ||||||
|  | 
 | ||||||
| PUBLIC int utime(name, timp) | PUBLIC int utime(name, timp) | ||||||
| char *name; | char *name; | ||||||
| struct utimbuf *timp; | struct utimbuf *timp; | ||||||
|  |  | ||||||
|  | @ -1,12 +1,12 @@ | ||||||
| /* POSIX fpathconf (Sec. 5.7.1) 		Author: Andy Tanenbaum */ | /* POSIX fpathconf (Sec. 5.7.1) 		Author: Andy Tanenbaum */ | ||||||
| 
 | 
 | ||||||
| #include <lib.h> | #include <lib.h> | ||||||
|  | #include <unistd.h> | ||||||
| #include <sys/types.h> | #include <sys/types.h> | ||||||
| #define fstat	_fstat | #define fstat	_fstat | ||||||
| #include <sys/stat.h> | #include <sys/stat.h> | ||||||
| #include <errno.h> | #include <errno.h> | ||||||
| #include <limits.h> | #include <limits.h> | ||||||
| #include <unistd.h> |  | ||||||
| 
 | 
 | ||||||
| PUBLIC long fpathconf(fd, name) | PUBLIC long fpathconf(fd, name) | ||||||
| int fd;				/* file descriptor being interrogated */ | int fd;				/* file descriptor being interrogated */ | ||||||
|  |  | ||||||
|  | @ -6,7 +6,6 @@ | ||||||
| #include <fcntl.h> | #include <fcntl.h> | ||||||
| #include <errno.h> | #include <errno.h> | ||||||
| #define close	_close | #define close	_close | ||||||
| #include <unistd.h> |  | ||||||
| 
 | 
 | ||||||
| PUBLIC long pathconf(path, name) | PUBLIC long pathconf(path, name) | ||||||
| char *path;			/* name of file being interrogated */ | char *path;			/* name of file being interrogated */ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue