|
News,
Internal,
Projects,
Home Software, Support, Documentation |
On Fri, May 14, 2004 at 05:27:07PM +0900, Seung-joo Lee wrote:
...
sem_t *mutex;
/* mutex = sem_open (SEM_NAME, O_CREAT | O_EXCL, FILE_MODE, 1); */
/* mutex = sem_open (SEM_NAME, O_CREAT | O_EXCL); */
mutex = sem_open (SEM_NAME, O_CREAT);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
POSIX sem_open(3)을 살펴보세요.
O_CREAT Create the semaphore if it does not already exist.
The third argument to the call to sem_open() must be of type
mode_t and specifies the mode for the semaphore. Only the
S_IWUSR, S_IWGRP, and S_IWOTH bits are examined; it is not pos-
sible to grant only ``read'' permission on a semaphore. The
mode is modified according to the process's file creation mask;
see umask(2).
The fourth argument must be an unsigned int and specifies the
initial value for the semaphore, and must be no greater than
SEM_VALUE_MAX.
if ( mutex == SEM_FAILED )
...
--
Pyun YongHyeon <http://www.kr.freebsd.org/~yongari>
_______________________________________________
한국 FreeBSD 사용자 그룹(KFUG) questions 메일링 리스트
questions at kr.FreeBSD.org
http://www.kr.FreeBSD.org/mailman/listinfo/questions
|
Copyright © 1998-2005 Korea FreeBSD Users Group. All rights reserved. webmaster at kr.FreeBSD.org $Date: 2004/05/17 15:58:49 $ |
|