Korea FreeBSD Users Group News, Internal, Projects, Home
Software, Support, Documentation

Re: [KFUG] POSIX named semaphore



[ ³¯Â¥¼ø »öÀÎ ] [ ´ñ±Û¼ø »öÀÎ ] [ ÃÖ»óÀ§ »öÀÎ] [ °Ë»ö]

[ÀÌÀü ±Û] [´ÙÀ½ ±Û] [ÀÌÀü ´ñ±Û] [´ÙÀ½ ´ñ±Û]


> ....
> 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 )
> ....

네, 제가 미처 그 부분을 읽지를 못했습니다.
그런데 그렇게 변경을 하고 해봐도 결과는 같게 나오더군요.
( mutex = sem_open ("/tmp/mysem", O_CREAT, S_IWUSR, 1); )
혹시 위 소스를 컴파일 해 보신 다른 분들은 되시나요?



____________________________________________________________________________
인터넷 카리스마 코넷!
대한민국 대표 초고속 인터넷 메가패스!


_______________________________________________
한국 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/18 16:01:25 $
Powered by FreeBSD