腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
如何使用
sem_open
为不同用户访问相同的信号量
semaphore
我已经使用根用户的
sem_open
()创建了全局信号量:所以当我这样做的时候: ls -al /dev/shm/现在我在
Linux
中有一个不同的用户(比如User1),它再次调用相同的函数
sem_open
来创建信号量:sem_t* sem =
sem_open
("
浏览 4
提问于2019-01-23
得票数 0
1
回答
信号量在OS上不断崩溃
c
、
macos
、
semaphore
我有以下代码:sem_t *semEmpty =
sem_open
("/semEmpty", O_CREAT, 0644, shared.buffSize); 这段代码在
Linux
上工作得很好,但是当我试图在OS上执行它时,我总是会得到分段错误。
浏览 3
提问于2016-04-27
得票数 2
回答已采纳
2
回答
Windows下用什么工具可以制作带工作命名信号量(
sem_open
)的控制台程序?
cygwin
、
semaphore
、
mingw-w64
、
msys2
尝试做一个gcc编译的可移植(
Linux
和Windows)的控制台程序。但在Windows下执行时得到"
sem_open
: Function not implemented“。其他一些使用
sem_open
()的工具(如Cygwin或MSYS2)是否支持使用
sem_open
()命名信号量? 谢谢。
浏览 30
提问于2019-11-11
得票数 0
回答已采纳
2
回答
带EINVAL初值为0的
sem_open
失败
c
、
linux
、
semaphore
我有一个在
Linux
上运行的简单示例:#include <stdio.h> sem_t *sem; if
浏览 11
提问于2022-08-25
得票数 1
回答已采纳
1
回答
通过共享库控制进程分叉
c
、
linux
、
shared-libraries
、
fork
、
shared-memory
我正在做一个实验项目(只是为了好玩),我需要一种方法来控制我的过程分叉的“节奏”。基本上,我有一个程序分叉自己,而不依附于它的孩子。子进程通过execl引导相同的程序。#include "hook.h" main() const char* progname = "main"; pid_t pid; { // Does some irrele
浏览 4
提问于2021-12-30
得票数 1
回答已采纳
2
回答
如何在C语言中对
sem_open
进行多次调用?
c
、
linux
、
semaphore
我在用C语言实现基于
Linux
的系统时,很难获得信号量。我的申请过程如下:如果我在分叉之前创建信号量,它可以正常工作。当我第二次尝试调用
sem_open
时,我会得到一个“拒绝权限”错误(通过errno)。 用任何方式都可以做到吗?或者是否有任何方式在一个进程中打开信号量并使用共享内存机制与子进程共享它?
浏览 9
提问于2010-02-19
得票数 9
回答已采纳
5
回答
如何停止
sem_open
()失败?
c
、
linux
、
ipc
、
posix
、
semaphore
我有两个Slackware
Linux
系统,它们的POSIX信号量
sem_open
()调用失败,errno设置为38。重现下面的示例代码(该代码在CentOS /RedHat上运行良好)。man
sem_open
建议此错误号表示系统不支持
sem_open
()。#define ENOSYS 38 /* Function not implemented */
sem_open
()用户空间位于我们动态链接的librt中,而librt位于受影响的系统上我认
浏览 28
提问于2008-11-07
得票数 3
回答已采纳
3
回答
sem_open
在
linux
下返回0
c++
、
linux
、
semaphore
include <fcntl.h>{ sem_t * my_semaphore =
sem_open
浏览 2
提问于2015-04-19
得票数 3
回答已采纳
2
回答
在Windows OS中,命名信号量的位置是什么
c
、
windows
、
semaphore
在
Linux
操作系统中,使用
sem_open
API在/dev/shm/位置创建命名信号量。我正在使用CreateSemaphore在Windows中创建命名信号量。
浏览 12
提问于2015-08-06
得票数 2
1
回答
如何从
linux
命令提示符中删除/释放一个命名的信号量?
linux
、
semaphore
、
ipcs
SIZE=4096; sync_tools cntxt={}; //initialize without memset cntxt.sem_array[1]=
sem_open
("
浏览 9
提问于2022-02-12
得票数 0
1
回答
在应用信号量之后,代码仍然无法按预期工作
c
、
semaphore
下面的代码应该输出NITER * 2,但似乎仍然没有互斥锁工作,你有什么想法吗?semaphore-example-add-semaphore.c:24:1: warning: control reaches end of non-void}1 warning generated.#include <stdio.h>#include <stdlib.h> #include <semaphor
浏览 1
提问于2012-10-28
得票数 0
回答已采纳
1
回答
如果我使用
sem_open
()而不是sem_init(),信号量的pshared值是多少?
c
、
posix
、
semaphore
、
multiple-processes
目前,我正在使用信号量和流程来解决餐饮业哲学家的问题,我使用
sem_open
()函数来创建信号量,而不是sem_init()。而且,由于
sem_open
()不接受pshared值作为参数。当使用
sem_open
()时,进程之间如何共享信号量?我认为这可能是因为信号量是在文件系统中打开的,但是更多的澄清将是非常感谢的。
浏览 10
提问于2022-07-03
得票数 1
回答已采纳
1
回答
osx上的
sem_open
共享内存在哪里?
ios
、
macos
、
shared-memory
、
semaphore
我目前正在为iOS移植一个C库,并且需要将原始的sem_init()更改为
sem_open
(),因为iOS不支持sem_init()谢谢
浏览 11
提问于2013-11-05
得票数 1
回答已采纳
2
回答
如果C中不支持函数重载,
sem_open
()如何接受不同的参数大小?
c
、
linux
、
operator-overloading
、
semaphore
、
variadic-functions
在学习共享流程信号量时,我注意到
sem_open
()具有两个函数原型:sem_t *
sem_open
(const
浏览 29
提问于2022-03-01
得票数 2
回答已采纳
1
回答
POSIX名为信号量存储在哪里?
linux
、
multiprocessing
、
posix
、
semaphore
命名信号量(使用semaphore.h)由表单/somename;的名称标识,即以null结尾的字符串最多为NAME_MAX-4 (即251个),该字符串由一个初始斜杠组成,后面跟着一个或多个字符,没有一个字符是斜杠。作为ipc是系统V semaphores.How定位POSIX信号量?
浏览 4
提问于2016-04-11
得票数 4
回答已采纳
1
回答
生产者和消费者中的sem_wait()
c
int main(int argc, char *argv[]) { empty =
sem_open
("/mysem", O_CREAT, 0644, BUFFER_SIZE); pthread_create(&con_thread, NULL, c
浏览 7
提问于2016-04-20
得票数 1
回答已采纳
1
回答
打开信号量返回%0
c
、
ipc
、
semaphore
、
posix-api
* cathFlag="/cathf";char* hypFlag="/hypf"; sem_t *csem =
sem_open
(cath, O_CREAT, 0777, 0);perror("ERROR: "); sem_t *cfsem =
sem_open
(c
浏览 18
提问于2020-10-17
得票数 0
回答已采纳
1
回答
命名POSIX信号量的问题
multithreading
、
posix
、
semaphore
EXIT_FAILURE */ { int i; printf("
sem_open
returned %p at line %u\n", semaphore,semaphore) semapho
浏览 0
提问于2016-02-24
得票数 1
2
回答
在C++中没有正确创建信号量
c
、
linux
、
semaphore
if ((sem_t *semaphore =
sem_open
("/sem1", O_CREAT | O_EXCL, 0644, 1))似乎如果出现错误
浏览 1
提问于2014-04-30
得票数 0
2
回答
使用信号量的一些问题
c
、
synchronization
、
semaphore
实际上我是在Mac上编程,但我试图在
Linux
上编译我的项目,但它不能编译。在OS上,它可以编译,但每次都会在初始化时崩溃。ERROR = ESEM; ERROR = ESEM;}int ERROR = EOK;mutex_2 =
sem_
浏览 5
提问于2012-05-02
得票数 3
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
Linux DNS 查询剖析 Linux 中国
Manjaro Linux 22.0 发布|Linux 中国
Alpine Linux 3.18 发布|Linux 中国
Linux基础(3)linux命令3
linux高级课程-在Linux中编程
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券