From e79a283e4760f7c1d2f289f796458ce50196154f Mon Sep 17 00:00:00 2001 From: kleink Date: Mon, 12 Jul 1999 21:55:19 +0000 Subject: [PATCH] XSH5: change function signature to `void *sbrk(intptr_t)'. --- include/unistd.h | 12 +++++++++--- lib/libc/sys/Lint_sbrk.c | 6 +++--- lib/libc/sys/brk.2 | 15 ++++----------- sys/compat/aout/syscalls.master | 4 ++-- sys/compat/freebsd/syscalls.master | 4 ++-- sys/compat/netbsd32/netbsd32.h | 4 +++- sys/compat/netbsd32/syscalls.master | 4 ++-- sys/compat/sunos/syscalls.master | 4 ++-- sys/compat/ultrix/syscalls.master | 4 ++-- sys/kern/syscalls.master | 6 ++++-- sys/uvm/uvm_mmap.c | 4 ++-- 11 files changed, 35 insertions(+), 32 deletions(-) diff --git a/include/unistd.h b/include/unistd.h index e6e8854f928e..25e274802dae 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1,7 +1,7 @@ -/* $NetBSD: unistd.h,v 1.76 1999/07/03 13:22:06 kleink Exp $ */ +/* $NetBSD: unistd.h,v 1.77 1999/07/12 21:55:19 kleink Exp $ */ /*- - * Copyright (c) 1998 The NetBSD Foundation, Inc. + * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -74,6 +74,7 @@ #ifndef _UNISTD_H_ #define _UNISTD_H_ +#include #include #include #include @@ -216,6 +217,11 @@ pid_t getsid __P((pid_t)); #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \ (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \ (_XOPEN_SOURCE - 0) >= 500 +#ifdef _BSD_INTPTR_T_ +typedef _BSD_INTPTR_T_ intptr_t; +#undef _BSD_INTPTR_T_ +#endif + #define F_ULOCK 0 #define F_LOCK 1 #define F_TLOCK 2 @@ -241,7 +247,7 @@ int lchown __P((const char *, uid_t, gid_t)); #endif int lockf __P((int, int, off_t)); int readlink __P((const char *, char *, size_t)); -char *sbrk __P((int)); +void *sbrk __P((intptr_t)); /* XXX prototype wrong! */ int setpgrp __P((pid_t pid, pid_t pgrp)); /* obsoleted by setpgid() */ int setregid __P((gid_t, gid_t)); diff --git a/lib/libc/sys/Lint_sbrk.c b/lib/libc/sys/Lint_sbrk.c index 137ad4339f36..0eb3f48dbc1d 100644 --- a/lib/libc/sys/Lint_sbrk.c +++ b/lib/libc/sys/Lint_sbrk.c @@ -1,4 +1,4 @@ -/* $NetBSD: Lint_sbrk.c,v 1.1 1997/11/06 00:53:04 cgd Exp $ */ +/* $NetBSD: Lint_sbrk.c,v 1.2 1999/07/12 21:55:19 kleink Exp $ */ /* * This file placed in the public domain. @@ -8,9 +8,9 @@ #include /*ARGSUSED*/ -char * +void * sbrk(incr) - int incr; + intptr_t incr; { return (0); } diff --git a/lib/libc/sys/brk.2 b/lib/libc/sys/brk.2 index 829b6ca92ccc..665c11b19eb2 100644 --- a/lib/libc/sys/brk.2 +++ b/lib/libc/sys/brk.2 @@ -1,4 +1,4 @@ -.\" $NetBSD: brk.2,v 1.19 1999/07/12 14:51:10 kleink Exp $ +.\" $NetBSD: brk.2,v 1.20 1999/07/12 21:55:19 kleink Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -33,7 +33,7 @@ .\" .\" @(#)brk.2 8.4 (Berkeley) 5/1/95 .\" -.Dd July 6, 1999 +.Dd July 12, 1999 .Dt BRK 2 .Os .Sh NAME @@ -44,8 +44,8 @@ .Fd #include .Ft int .Fn brk "void *addr" -.Ft char * -.Fn sbrk "int incr" +.Ft void * +.Fn sbrk "intptr_t incr" .Sh DESCRIPTION .Bf -symbolic The brk and sbrk functions are legacy interfaces from before the @@ -158,13 +158,6 @@ with and similar functions may result in non-portable program behavior. Caution is advised. .Pp -The Single UNIX Specification, Version 2, says that -.Fn sbrk -should look like -.Fn "void *sbrk" "intptr_t incr" , -and our usage conflicts with that. Presumably this will have to be -fixed in the future, creating much pain for everyone. -.Pp Setting the break may fail due to a temporary lack of swap space. It is not possible to distinguish this from a failure caused by exceeding the maximum size of the data segment without consulting diff --git a/sys/compat/aout/syscalls.master b/sys/compat/aout/syscalls.master index 1e5cc8febbed..1dd214ee2ae2 100644 --- a/sys/compat/aout/syscalls.master +++ b/sys/compat/aout/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.3 1999/06/09 04:27:44 christos Exp $ + $NetBSD: syscalls.master,v 1.4 1999/07/12 21:55:19 kleink Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -164,7 +164,7 @@ 66 NOARGS { int sys_vfork(void); } 67 OBSOL vread 68 OBSOL vwrite -69 NOARGS { int sys_sbrk(int incr); } +69 NOARGS { int sys_sbrk(intptr_t incr); } 70 NOARGS { int sys_sstk(int incr); } 71 NOARGS { int compat_43_sys_mmap(caddr_t addr, size_t len, \ int prot, int flags, int fd, long pos); } ommap diff --git a/sys/compat/freebsd/syscalls.master b/sys/compat/freebsd/syscalls.master index ef3452717f9d..6dcaf911c1b2 100644 --- a/sys/compat/freebsd/syscalls.master +++ b/sys/compat/freebsd/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.23 1999/06/09 12:33:18 drochner Exp $ + $NetBSD: syscalls.master,v 1.24 1999/07/12 21:55:20 kleink Exp $ ; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -160,7 +160,7 @@ 66 NOARGS { int sys_vfork(void); } 67 OBSOL vread 68 OBSOL vwrite -69 NOARGS { int sys_sbrk(int incr); } +69 NOARGS { int sys_sbrk(intptr_t incr); } 70 NOARGS { int sys_sstk(int incr); } 71 NOARGS { int compat_43_sys_mmap(caddr_t addr, size_t len, \ int prot, int flags, int fd, long pos); } ommap diff --git a/sys/compat/netbsd32/netbsd32.h b/sys/compat/netbsd32/netbsd32.h index a37207c95018..b157ec18c296 100644 --- a/sys/compat/netbsd32/netbsd32.h +++ b/sys/compat/netbsd32/netbsd32.h @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.7 1999/03/25 17:57:21 mrg Exp $ */ +/* $NetBSD: netbsd32.h,v 1.8 1999/07/12 21:55:20 kleink Exp $ */ /* * Copyright (c) 1998 Matthew R. Green @@ -53,6 +53,8 @@ typedef int32_t netbsd32_ssize_t; typedef int32_t netbsd32_clockid_t; typedef u_int32_t netbsd32_caddr_t; typedef int32_t netbsd32_key_t; +typedef int32_t netbsd32_intptr_t; +typedef u_int32_t netbsd32_uintptr_t; /* all pointers are u_int32_t */ diff --git a/sys/compat/netbsd32/syscalls.master b/sys/compat/netbsd32/syscalls.master index 2e7b28df96e3..d4a7fa5ef8ac 100644 --- a/sys/compat/netbsd32/syscalls.master +++ b/sys/compat/netbsd32/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.8 1999/06/09 04:50:11 christos Exp $ + $NetBSD: syscalls.master,v 1.9 1999/07/12 21:55:20 kleink Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -139,7 +139,7 @@ 66 NOARGS { int sys_vfork(void); } 67 OBSOL vread 68 OBSOL vwrite -69 STD { int compat_netbsd32_sbrk(int incr); } +69 STD { int compat_netbsd32_sbrk(netbsd32_intptr_t incr); } 70 STD { int compat_netbsd32_sstk(int incr); } 71 COMPAT_43 { int compat_netbsd32_ommap(netbsd32_caddr_t addr, netbsd32_size_t len, int prot, int flags, int fd, netbsd32_long pos); } 72 STD { int compat_netbsd32_ovadvise(int anom); } vadvise diff --git a/sys/compat/sunos/syscalls.master b/sys/compat/sunos/syscalls.master index a964797fde8d..edd1621ef543 100644 --- a/sys/compat/sunos/syscalls.master +++ b/sys/compat/sunos/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.52 1999/03/22 17:28:21 sommerfe Exp $ + $NetBSD: syscalls.master,v 1.53 1999/07/12 21:55:20 kleink Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -126,7 +126,7 @@ 66 NOARGS { int sys_vfork(void); } 67 OBSOL vread 68 OBSOL vwrite -69 NOARGS { int sys_sbrk(int incr); } +69 NOARGS { int sys_sbrk(intptr_t incr); } 70 NOARGS { int sys_sstk(int incr); } 71 STD { void *sunos_sys_mmap(void *addr, size_t len, \ int prot, int flags, int fd, long pos); } diff --git a/sys/compat/ultrix/syscalls.master b/sys/compat/ultrix/syscalls.master index 2b07227329b8..9af725536a3b 100644 --- a/sys/compat/ultrix/syscalls.master +++ b/sys/compat/ultrix/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.30 1999/02/09 20:30:38 christos Exp $ + $NetBSD: syscalls.master,v 1.31 1999/07/12 21:55:20 kleink Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -119,7 +119,7 @@ 66 NOARGS { int sys_vfork(void); } 67 OBSOL vread 68 OBSOL vwrite -69 NOARGS { int sys_sbrk(int incr); } +69 NOARGS { int sys_sbrk(intptr_t incr); } 70 NOARGS { int sys_sstk(int incr); } 71 STD { int ultrix_sys_mmap(caddr_t addr, size_t len, \ int prot, u_int flags, int fd, long pos); } diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index af453c82c792..c1370be75cbe 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.94 1999/06/29 22:15:31 wrstuden Exp $ + $NetBSD: syscalls.master,v 1.95 1999/07/12 21:55:21 kleink Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -159,7 +159,7 @@ 66 STD { int sys_vfork(void); } 67 OBSOL vread 68 OBSOL vwrite -69 STD { int sys_sbrk(int incr); } +69 STD { int sys_sbrk(intptr_t incr); } 70 STD { int sys_sstk(int incr); } 71 COMPAT_43 { int sys_mmap(caddr_t addr, size_t len, int prot, \ int flags, int fd, long pos); } ommap @@ -565,3 +565,5 @@ struct stat *sb); } 300 STD { int sys_fhstatfs(const fhandle_t *fhp, \ struct statfs *buf); } +301 STD { int sys_getcontext(struct ucontext *ucp); } +302 STD { int sys_setcontext(const struct ucontext *ucp); } diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c index 67fe4eceb39f..9b86bba62a15 100644 --- a/sys/uvm/uvm_mmap.c +++ b/sys/uvm/uvm_mmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_mmap.c,v 1.32 1999/07/10 20:40:23 thorpej Exp $ */ +/* $NetBSD: uvm_mmap.c,v 1.33 1999/07/12 21:55:21 kleink Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -92,7 +92,7 @@ sys_sbrk(p, v, retval) { #if 0 struct sys_sbrk_args /* { - syscallarg(int) incr; + syscallarg(intptr_t) incr; } */ *uap = v; #endif