由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - shm_open failed
相关主题
又一个GDB的问题:关于显示数据请教有关header file的几个问题
请高人解释一下为啥这个输出总是"HELLO-ERR"Intel C++ compiler 求教
c++,这种做法不行?外行问个compile的事, 大牛们帮帮我
compiler created methodsnamespace defined in another file
create a copy of solution project and also save the compiler/linker setup弱问C++一个问题 一直不解
java vs javascript求助:怎么能support头文件#include
how to use hashtable in C++恨透了以linux为首的open source (转载)
怎样include一个函数C array
相关话题的讨论汇总
话题: include话题: shm话题: open话题: sys话题: failed
进入Programming版参与讨论
1 (共1页)
M**********n
发帖数: 432
1
#include
#include
#include
#include
#include
#include
#include
#include
int main()
{
int fd;

if((fd = shm_open("/dev/shm/ttt", (O_RDWR|O_CREAT), (S_IRUSR | S_IWUSR
| S_IRGRP | S_IWGRP |
S_IROTH | S_IWOTH ))) <
0)
{
fprintf(stderr, "failed to open file %sn", strerror(errno));
exit(1);
}
return 0;
}
After compiling this simple program, I always got "failed to open file No
such
file or directory" if I run it. But if I changed shm_open to open, it worked
fine.
Does anyone know what is the problem here?
M**********n
发帖数: 432
2
Seems like I only need to specify the file name with path in the case of shm
_open.

【在 M**********n 的大作中提到】
: #include
: #include
: #include
: #include
: #include
: #include
: #include
: #include
: int main()
: {

s*******8
发帖数: 12734
3
shm_open("/yourusernmae");

shm

【在 M**********n 的大作中提到】
: Seems like I only need to specify the file name with path in the case of shm
: _open.

1 (共1页)
进入Programming版参与讨论
相关主题
C arraycreate a copy of solution project and also save the compiler/linker setup
A C++ compiler related interview questionjava vs javascript
*** help needed! on MATLAB GUI ***how to use hashtable in C++
关于fscanf格式化读取的问题.怎样include一个函数
又一个GDB的问题:关于显示数据请教有关header file的几个问题
请高人解释一下为啥这个输出总是"HELLO-ERR"Intel C++ compiler 求教
c++,这种做法不行?外行问个compile的事, 大牛们帮帮我
compiler created methodsnamespace defined in another file
相关话题的讨论汇总
话题: include话题: shm话题: open话题: sys话题: failed