c******n 发帖数: 4965 | 1 【 以下文字转载自 Linux 讨论区 】
【 原文由 creation 所发表 】
in semaphore, if I want to use the semaphore between processes
I have to put the semaphore in shared memory
i.e.
for sem_init(sem_t *sem,.....)
the #sem# has to be in shared mem
but I can't tell malloc to allocate a #sem# in
a particular region,
neither can I tell shmat() to attach to an existing
real memory region (i.e.
sem=malloc()
shmat(shm_id, sem,...)
)
so how can i do this?
(2) in open('filename', O_XXXX, S_IRUSR) , the S_IRUSR flag,
where does |
|