Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sem(4) [freebsd man page]

SEM(4)							   BSD Kernel Interfaces Manual 						    SEM(4)

NAME
sem -- POSIX semaphores SYNOPSIS
To compile this driver into the kernel, place the following line in your kernel configuration file: options P1003_1B_SEMAPHORES Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): sem_load="YES" To load the driver as a module at run-time, run the following command as root: kldload sem DESCRIPTION
The sem facility provides system calls used by the standard C library (libc) to implement POSIX semaphores. This facility offers support for such functions as sem_init() and sem_wait(). It is available both as a kernel option for static inclusion and as a dynamic kernel module. SEE ALSO
sem_destroy(3), sem_getvalue(3), sem_init(3), sem_open(3), sem_post(3), sem_wait(3), config(8), kldload(8), kldunload(8) HISTORY
The sem facility appeared in FreeBSD 5.0. BSD
February 7, 2014 BSD

Check Out this Related Man Page

SEM_INIT(3)						   BSD Library Functions Manual 					       SEM_INIT(3)

NAME
sem_init -- initialize an unnamed semaphore LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <semaphore.h> int sem_init(sem_t *sem, int pshared, unsigned int value); DESCRIPTION
The sem_init() function initializes the unnamed semaphore pointed to by sem to have the value value. A non-zero value for pshared specifies a shared semaphore that can be used by multiple processes, the semaphore should be located in shared memory region (see mmap(2), shm_open(2), and shmget(2)), any process having read and write access to address sem can perform semaphore opera- tions on sem. Following a successful call to sem_init(), sem can be used as an argument in subsequent calls to sem_wait(3), sem_trywait(3), sem_post(3), and sem_destroy(3). The sem argument is no longer valid after a successful call to sem_destroy(3). RETURN VALUES
The sem_init() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indi- cate the error. ERRORS
The sem_init() function will fail if: [EINVAL] The value argument exceeds SEM_VALUE_MAX. [ENOSPC] Memory allocation error. SEE ALSO
sem_destroy(3), sem_getvalue(3), sem_post(3), sem_trywait(3), sem_wait(3) STANDARDS
The sem_init() function conforms to ISO/IEC 9945-1:1996 (``POSIX.1''). BSD
January 9, 2010 BSD
Man Page

9 More Discussions You Might Find Interesting

1. BSD

Kernel Problems

Hey guys, I have installed Freebsd 5.3 Release, and I can't compile my custom kernel. I even tried compile the Generic kernel to see if I had some error in my custom kernel, and that didn't compile either. The Freebsd FAQ pages states one solution would be to "re-fetch the source tree". How is... (8 Replies)
Discussion started by: icecoldslimburn
8 Replies

2. UNIX for Advanced & Expert Users

Effect of Preemptive Kernel

hi there, i am porting kernel 2.2 driver program to kernel 2.6. for some extent i am successfull but some times the system gets hanged. what might be the problem? i am not able to get any help from log messages as nothing is being printed at that moment. hey does this kernel preemptiveness and... (2 Replies)
Discussion started by: sriram.ec
2 Replies

3. BSD

FreeBSD - Kernel Queries/Issues

All, I am a bit of a BSD newbie and haven't really played with it for years, but I have had a recent situation whereby someone attempted to load a custom kernel module and ended up breaking my BSD server. I managed to fix it by doing the following: Booting into loader mode: unload set... (3 Replies)
Discussion started by: drbabbers
3 Replies

4. Web Development

Difference between SEM and SEO

(0 Replies)
Discussion started by: IntegratedS
0 Replies

5. Programming

Undefined: sem_init, sem_post, sem_wait

Hi friends, I am using semaphores in my program, but when I compile the program, it gives the following error $ gcc sem.c -o sem -lpthread Undefined first referenced symbol in file sem_init ... (1 Reply)
Discussion started by: gabam
1 Replies

6. Linux

Is it possible to insert compile module after compiled "make" without installing

Hi gud day, I would like to ask if possible to load the driver i compiled module without installing it in the ubuntu-kernel-distro/updates* or simple not executing "make install". what i mean is i compile the compat wireless driver using make and i want to try to load on the system without... (1 Reply)
Discussion started by: jao_madn
1 Replies

7. Shell Programming and Scripting

Count and print the number of occurences

I have some files as shown below GLL ALM 654-656 654 656 SEM LYG 655-657 655 657 SEM LYG 655-657 655 657 ALM LEG 656-658 656 658 ALM LEG 656-658 656 658 ALM LEG 656-658 656 658 LEG LEG 658-660 658 660 LEG LEG 658-660 658 660 The value of GLL is... (5 Replies)
Discussion started by: arch
5 Replies

8. UNIX for Dummies Questions & Answers

How to pass cat file in awk statement?

Hi, I am working on kernel parameters, want to check values under /proc/sys/kernel below I tried for kernel.sem SEMMNS: 4096 cat /proc/sys/kernel/sem | awk '{print $2}' awk '{ if ($2 < 33000) print }' /proc/sys/kernel/sem |awk '{print $2}' 32000 The above... (7 Replies)
Discussion started by: stew
7 Replies

9. Shell Programming and Scripting

Conditional deletion of files based on extension

Hello All, I have some files like file, file.chk, file.sem and file.temp in huge. I would like to delete some files based on following criteria. 1. Unconditionally delete .sem and .temp files 2. If we found the actual file, don't remove .chk file, otherwise remove .chk file as well for... (5 Replies)
Discussion started by: VasuKukkapalli
5 Replies