added setsid man page.
authorChristoph Robitschko <chmr@edvz.tu-graz.ac.at>
Fri, 28 Jan 1994 19:10:59 +0000 (19:10 +0000)
committerChristoph Robitschko <chmr@edvz.tu-graz.ac.at>
Fri, 28 Jan 1994 19:10:59 +0000 (19:10 +0000)
lib/libc/sys/Makefile.inc
lib/libc/sys/setsid.2 [new file with mode: 0644]

index 6083ff8..1e70e36 100644 (file)
@@ -95,12 +95,12 @@ MAN2+=      sys/accept.2 sys/access.2 sys/acct.2 sys/adjtime.2 sys/async_daemon.2 \
        sys/msync.2 sys/munmap.2 sys/nfssvc.2 sys/open.2 sys/pipe.2 \
        sys/quotactl.2 sys/read.2 sys/readlink.2 sys/reboot.2 sys/recv.2 \
        sys/rename.2 sys/rmdir.2 sys/select.2 sys/send.2 sys/setgroups.2 \
        sys/msync.2 sys/munmap.2 sys/nfssvc.2 sys/open.2 sys/pipe.2 \
        sys/quotactl.2 sys/read.2 sys/readlink.2 sys/reboot.2 sys/recv.2 \
        sys/rename.2 sys/rmdir.2 sys/select.2 sys/send.2 sys/setgroups.2 \
-       sys/setpgid.2 sys/setregid.2 sys/setreuid.2 sys/shutdown.2 \
-       sys/sigaction.2 sys/sigprocmask.2 sys/sigreturn.2 sys/sigstack.2 \
-       sys/sigsuspend.2 sys/socket.2 sys/socketpair.2 sys/stat.2 \
-       sys/statfs.2 sys/swapon.2 sys/symlink.2 sys/sync.2 sys/syscall.2 \
-       sys/truncate.2 sys/umask.2 sys/uname.2 sys/unlink.2 sys/utimes.2 \
-       sys/vfork.2 sys/wait.2 sys/write.2
+       sys/setpgid.2 sys/setregid.2 sys/setreuid.2 sys/setsid.2 \
+       sys/shutdown.2 sys/sigaction.2 sys/sigprocmask.2 sys/sigreturn.2 \
+       sys/sigstack.2 sys/sigsuspend.2 sys/socket.2 sys/socketpair.2 \
+       sys/stat.2 sys/statfs.2 sys/swapon.2 sys/symlink.2 sys/sync.2 \
+       sys/syscall.2 sys/truncate.2 sys/umask.2 sys/uname.2 sys/unlink.2 \
+       sys/utimes.2 sys/vfork.2 sys/wait.2 sys/write.2
 
 MLINKS+=brk.2 sbrk.2
 MLINKS+=dup.2 dup2.2
 
 MLINKS+=brk.2 sbrk.2
 MLINKS+=dup.2 dup2.2
diff --git a/lib/libc/sys/setsid.2 b/lib/libc/sys/setsid.2
new file mode 100644 (file)
index 0000000..b4ff4db
--- /dev/null
@@ -0,0 +1,67 @@
+.\" Copyright (c) 1994 Christoph M. Robitschko
+.\" All rights reserved.
+.\"
+.\" 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 Christoph M. Robitschko
+.\" 4. The name of the author may not be used to endorse or promote products
+.\"    derived from this software withough specific prior written permission
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 28, 1994
+.Dt SETSID 2
+.Os FreeBSD
+.Sh NAME
+.Nm setsid
+.Nd create session and set process group ID
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Ft pid_t
+.Fn setsid
+.Sh DESCRIPTION
+If the calling process is not a process group leader, the 
+.Fn setsid
+function creates a new session and a new process group.
+The calling process is the session leader and process group leader, and
+has no controlling terminal.
+The ID of the process group is set to the process ID of the calling process.
+The calling process is the only member of the new session and of the new
+process group.
+.Sh RETURN VALUES
+.Fn Setsid
+returns the value of the new process group ID when the operation was successful.
+If the request failed, -1 is returned and the global variable
+.Va errno
+indicates the reason.
+.Sh ERRORS
+.Fn Setsid
+will fail if:
+.Bl -tag -width indent
+.It Bq Er EPERM
+The calling process is already a process group leader, or the process group ID
+of another process matches the process ID of the calling process.
+.El
+.Sh SEE ALSO
+.Xr getpid 2 ,
+.Xr setpgid 2
+.Sh STANDARDS
+.Fn Setpgid
+conforms to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .