Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/nathanw_sa]: src/lib/libc/sys Manual pages for the LWP-related system ca...



details:   https://anonhg.NetBSD.org/src/rev/5999671345cc
branches:  nathanw_sa
changeset: 506736:5999671345cc
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Jan 14 02:18:55 2003 +0000

description:
Manual pages for the LWP-related system calls.

XXX Note our current implementation mis-matches these slightly (error
codes are stuff into errno, where they should simply be returned by
these calls).  This will be addressed shortly.

diffstat:

 lib/libc/sys/Makefile.inc   |    6 +-
 lib/libc/sys/_lwp_create.2  |  107 ++++++++++++++++++++++++++++++++++++++++++++
 lib/libc/sys/_lwp_exit.2    |   68 +++++++++++++++++++++++++++
 lib/libc/sys/_lwp_self.2    |   63 +++++++++++++++++++++++++
 lib/libc/sys/_lwp_suspend.2 |  101 +++++++++++++++++++++++++++++++++++++++++
 lib/libc/sys/_lwp_wait.2    |   98 ++++++++++++++++++++++++++++++++++++++++
 lib/libc/sys/_lwp_wakeup.2  |   80 ++++++++++++++++++++++++++++++++
 7 files changed, 521 insertions(+), 2 deletions(-)

diffs (truncated from 568 to 300 lines):

diff -r ab6e3c8874eb -r 5999671345cc lib/libc/sys/Makefile.inc
--- a/lib/libc/sys/Makefile.inc Mon Jan 13 22:50:09 2003 +0000
+++ b/lib/libc/sys/Makefile.inc Tue Jan 14 02:18:55 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.111.2.15 2003/01/08 20:01:13 thorpej Exp $
+#      $NetBSD: Makefile.inc,v 1.111.2.16 2003/01/14 02:18:55 thorpej Exp $
 #      @(#)Makefile.inc        8.3 (Berkeley) 10/24/94
 
 # sys sources
@@ -128,7 +128,8 @@
        getsockopt.2 gettimeofday.2 getuid.2 intro.2 ioctl.2 issetugid.2 \
        kill.2 kqueue.2 ktrace.2 \
        lfs_bmapv.2 lfs_markv.2 lfs_segclean.2 lfs_segwait.2 \
-       link.2 listen.2 lseek.2 mkdir.2 mkfifo.2 mknod.2 \
+       link.2 listen.2 lseek.2 _lwp_create.2 _lwp_exit.2 _lwp_self.2 \
+       _lwp_suspend.2 _lwp_wakeup.2 _lwp_wait.2 mkdir.2 mkfifo.2 mknod.2 \
        madvise.2 mincore.2 minherit.2 mlock.2 mlockall.2 mmap.2 mount.2 \
        mprotect.2 msgctl.2 msgget.2 msgrcv.2 msgsnd.2 msync.2 \
        munmap.2 nanosleep.2 nfssvc.2 ntp_adjtime.2 open.2 pathconf.2 pipe.2 \
@@ -169,6 +170,7 @@
 MLINKS+=kqueue.2 kevent.2
 MLINKS+=ktrace.2 fktrace.2
 MLINKS+=lseek.2 seek.2
+MLINKS+=_lwp_suspend.2 _lwp_create.2
 MLINKS+=mlock.2 munlock.2
 MLINKS+=mlockall.2 munlockall.2
 MLINKS+=mount.2 unmount.2
diff -r ab6e3c8874eb -r 5999671345cc lib/libc/sys/_lwp_create.2
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/sys/_lwp_create.2        Tue Jan 14 02:18:55 2003 +0000
@@ -0,0 +1,107 @@
+.\"    $NetBSD: _lwp_create.2,v 1.1.2.1 2003/01/14 02:18:55 thorpej Exp $
+.\"
+.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Jason R. Thorpe of Wasabi Systems, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"        This product includes software developed by the NetBSD
+.\"        Foundation, Inc. and its contributors.
+.\" 4. Neither the name of The NetBSD Foundation nor the names of its
+.\"    contributors may be used to endorse or promote products derived
+.\"    from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd January 13, 2003
+.Dt _LWP_CREATE 2
+.Os
+.Sh NAME
+.Nm _lwp_create
+.Nd create a new light-weight process
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.Fd #include \*[Lt]lwp.h\*[Gt]
+.Ft int
+.Fn _lwp_create "ucontext_t *context" "unsigned long flags" "lwpid_t *new_lwp"
+.Sh DESCRIPTION
+.Fn _lwp_create
+causes creation of a new light-weight process, or LWP, and adds it to the
+current process.
+The
+.Fa context
+argument specifies the initial execution context for the new LWP including
+signal mask, stack, and machine registers.
+.Pp
+The following flags affect the creation of the new LWP:
+.Bl -tag -width LWP_SUSPENDED
+.It LWP_DETACHED
+The LWP is created detached.
+The resources associated with a detached LWP will be automatically
+reclaimed by the system when the LWP exits.
+Otherwise, a terminated LWP's resources will not be reclaimed until
+its status is reported to another LWP via
+.Xr _lwp_wait 2 .
+.It LWP_SUSPENDED
+The LWP is created suspended, and will not begin execution until
+it is resumbed by another LWP via
+.Xr _lwp_continue 2 .
+.\" __LWP_ASLWP is not yet implemented by the NetBSD kernel.
+.El
+.Pp
+The LWP ID of the new LWP is stored in the location pointed to by
+.Fa new_lwp .
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn _lwp_create
+returns a value of 0.
+Otherwise, an error code is returned to indicate the error.
+.Sh ERRORS
+.Fn _lwp_create
+will fail and no LWP will be created if:
+.Bl -tag -width [EAGAIN]
+.It Bq Er EAGAIN
+The system-imposed limit on the total
+number of LWPs under execution would be exceeded.
+This limit is configuration-dependent.
+.It Bq Er ENOMEM
+There is insufficient swap space for the new LWP.
+.It Bq Er EFAULT
+The address pointed to by
+.Fa context
+or
+.Fa new_lwp
+is outside the process's allocated address space.
+.El
+.Sh SEE ALSO
+.Xr _lwp_continue 2 ,
+.Xr _lwp_exit 2 ,
+.Xr _lwp_makecontext 2 ,
+.Xr _lwp_wait 2
+.Sh HISTORY
+The
+.Fn _lwp_create
+system call first appeared in
+.Nx 2.0 .
diff -r ab6e3c8874eb -r 5999671345cc lib/libc/sys/_lwp_exit.2
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/sys/_lwp_exit.2  Tue Jan 14 02:18:55 2003 +0000
@@ -0,0 +1,68 @@
+.\"    $NetBSD: _lwp_exit.2,v 1.1.2.1 2003/01/14 02:18:55 thorpej Exp $
+.\"
+.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Jason R. Thorpe of Wasabi Systems, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"        This product includes software developed by the NetBSD
+.\"        Foundation, Inc. and its contributors.
+.\" 4. Neither the name of The NetBSD Foundation nor the names of its
+.\"    contributors may be used to endorse or promote products derived
+.\"    from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd January 13, 2003
+.Dt _LWP_EXIT 2
+.Os
+.Sh NAME
+.Nm _lwp_exit
+.Nd terminate the calling light-weight process
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.Fd #include \*[Lt]lwp.h\*[Gt]
+.Ft void
+.Fn _lwp_exit void
+.Sh DESCRIPTION
+.Fn _lwp_exit
+terminates the calling LWP.
+If it is the last LWP in the process, the process exits with a status of 0.
+If the LWP was not created in a detached state, then the system will not
+reclaim its LWP ID until its status is reported to another LWP in the process
+via
+.Xr _lwp_wait 2 .
+.Sh RETURN VALUES
+.Fn _lwp_exit
+can never return.
+.Sh SEE ALSO
+.Xr _exit 2 ,
+.Xr _lwp_create 2 ,
+.Xr _lwp_wait 2 ,
+.Sh HISTORY
+The
+.Fn _lwp_exit
+system call first appeared in
+.Nx 2.0 .
diff -r ab6e3c8874eb -r 5999671345cc lib/libc/sys/_lwp_self.2
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/sys/_lwp_self.2  Tue Jan 14 02:18:55 2003 +0000
@@ -0,0 +1,63 @@
+.\"    $NetBSD: _lwp_self.2,v 1.1.2.1 2003/01/14 02:18:55 thorpej Exp $
+.\"
+.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Jason R. Thorpe of Wasabi Systems, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"        This product includes software developed by the NetBSD
+.\"        Foundation, Inc. and its contributors.
+.\" 4. Neither the name of The NetBSD Foundation nor the names of its
+.\"    contributors may be used to endorse or promote products derived
+.\"    from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd January 13, 2003
+.Dt _LWP_SELF 2
+.Os
+.Sh NAME
+.Nm _lwp_self
+.Nd get light-weight process identification
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.Fd #include \*[Lt]lwp.h\*[Gt]
+.Ft lwpid_t
+.Fn _lwp_self void
+.Sh DESCRIPTION
+.Fn _lwp_self
+returns the LWP ID of the calling LWP.
+.Sh ERRORS
+The
+.Fn _lwp_self
+function is always successful, and no return value is reserved to indicate
+an error.
+.Sh SEE ALSO
+.Xr _lwp_create 2
+.Sh HISTORY
+The
+.Fn _lwp_self
+system call first appeared in
+.Nx 2.0 .
diff -r ab6e3c8874eb -r 5999671345cc lib/libc/sys/_lwp_suspend.2
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/sys/_lwp_suspend.2       Tue Jan 14 02:18:55 2003 +0000
@@ -0,0 +1,101 @@
+.\"    $NetBSD: _lwp_suspend.2,v 1.1.2.1 2003/01/14 02:18:55 thorpej Exp $
+.\"
+.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Jason R. Thorpe of Wasabi Systems, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"        This product includes software developed by the NetBSD



Home | Main Index | Thread Index | Old Index