OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man3 / sem_close.3
1 '\" t
2 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\"
4 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
5 .\"
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .TH SEM_CLOSE 3 2006-03-25 "Linux" "Linux Programmer's Manual"
27 .SH NAME
28 sem_close \- close a named semaphore
29 .SH SYNOPSIS
30 .nf
31 .B #include <semaphore.h>
32 .sp
33 .BI "int sem_close(sem_t *" sem );
34 .fi
35 .sp
36 Link with \fI\-lrt\fP or \fI\-pthread\fP.
37 .SH DESCRIPTION
38 .BR sem_close ()
39 closes the named semaphore referred to by
40 .IR sem ,
41 allowing any resources that the system has allocated to
42 the calling process for this semaphore to be freed.
43 .SH RETURN VALUE
44 On success
45 .BR sem_close ()
46 returns 0; on error, \-1 is returned, with
47 .I errno
48 set to indicate the error.
49 .SH ERRORS
50 .TP
51 .B EINVAL
52 .I sem
53 is not a valid semaphore.
54 .SH CONFORMING TO
55 POSIX.1-2001.
56 .SH NOTES
57 All open named semaphores are automatically closed on process
58 termination, or upon
59 .BR execve (2).
60 .SH "SEE ALSO"
61 .BR sem_getvalue (3),
62 .BR sem_open (3),
63 .BR sem_post (3),
64 .BR sem_unlink (3),
65 .BR sem_wait (3),
66 .BR sem_overview (7)