由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - [转载] two programming questions
相关主题
interview question[转载] 为什么会在调用malloc时Segmentation fault?
alloc memory in UNIX[转载] Re: 为什么会在调用malloc时Segmentation fault?
how to use function calloc of c in fortran?Memory check problem?
help for g77async-signal safe 问题
Unix semaphore[转载] help about C: realloc
Semaphores in Linux (转载)请问,malloc函数怎样实现?
[转载] shared library一问dtrace问题
Is it possible?[转载] cxterm
相关话题的讨论汇总
话题: sem话题: semaphore话题: shmat话题: irusr
进入Unix版参与讨论
1 (共1页)
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
1 (共1页)
进入Unix版参与讨论
相关主题
[转载] cxtermUnix semaphore
segmentation fault when using "script"Semaphores in Linux (转载)
Abort(coredump) ??????????????[转载] shared library一问
Shell Script QuestionIs it possible?
interview question[转载] 为什么会在调用malloc时Segmentation fault?
alloc memory in UNIX[转载] Re: 为什么会在调用malloc时Segmentation fault?
how to use function calloc of c in fortran?Memory check problem?
help for g77async-signal safe 问题
相关话题的讨论汇总
话题: sem话题: semaphore话题: shmat话题: irusr