boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - shm_open failed
相关主题
又一个GDB的问题:关于显示数据
请高人解释一下为啥这个输出总是"HELLO-ERR"
c++,这种做法不行?
compiler created methods
create a copy of solution project and also save the compiler/linker setup
java vs javascript
how to use hashtable in C++
怎样include一个函数
请教有关header file的几个问题
Intel C++ compiler 求教
相关话题的讨论汇总
话题: 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版参与讨论
相关主题
Intel C++ compiler 求教
外行问个compile的事, 大牛们帮帮我
namespace defined in another file
弱问C++一个问题 一直不解
求助:怎么能support头文件#include
恨透了以linux为首的open source (转载)
C array
A C++ compiler related interview question
*** help needed! on MATLAB GUI ***
关于fscanf格式化读取的问题.
相关话题的讨论汇总
话题: include话题: shm话题: open话题: sys话题: failed