XSH5: change function signature to `void *sbrk(intptr_t)'.

This commit is contained in:
kleink 1999-07-12 21:55:19 +00:00
parent 51301b7324
commit e79a283e47
11 changed files with 35 additions and 32 deletions

View File

@ -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 <machine/ansi.h>
#include <sys/cdefs.h>
#include <sys/featuretest.h>
#include <sys/types.h>
@ -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));

View File

@ -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 <unistd.h>
/*ARGSUSED*/
char *
void *
sbrk(incr)
int incr;
intptr_t incr;
{
return (0);
}

View File

@ -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 <unistd.h>
.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

View File

@ -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

View File

@ -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

View File

@ -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 */

View File

@ -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

View File

@ -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); }

View File

@ -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); }

View File

@ -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); }

View File

@ -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