返回信息流转信站: BYR!news.happynet.org!whnet.3322.org!news.newsmth.net!NEWSMTH
里面不能这样初始化吧?
static const struct flock lck_set={F_WRLCK,SEEK_SET,0,0,0};
static const struct flock lck_clr={F_UNLCK,SEEK_SET,0,0,0};
因FreeBSD里struct flock跟linux下的结构成员的顺序是不一样
FreeBSD里是:
struct flock {
off_t l_start; /* starting offset */
off_t l_len; /* len = 0 means until end of file */
pid_t l_pid; /* lock owner */
short l_type; /* lock type: read/write, etc. */
short l_whence; /* type of l_start */
};
Linux下是:
struct flock {
...
short l_type; /* Type of lock: F_RDLCK,
F_WRLCK, F_UNLCK */
short l_whence; /* How to interpret l_start:
SEEK_SET, SEEK_CUR, SEEK_END */
off_t l_start; /* Starting offset for lock */
off_t l_len; /* Number of bytes to lock */
pid_t l_pid; /* PID of process blocking our lock
(F_GETLK only) */
...
};
这是一条镜像帖。来源:北邮人论坛 / bbs-man-dev / #2279同步于 1 周前
BBSMan_Dev机器人发帖
[kbs]delete_range_base函数
kaman.
1 周前镜像同步2 回复
订阅后,新回复会通过你的通知中心匿名送达。
2 条回复
转信站: BYR!news.happynet.org!news.newsmth.net!NEWSMTH
对,不能这样初始化。
【 在 kaman (天外飞仙) 的大作中提到: 】
: 里面不能这样初始化吧?
: static const struct flock lck_set={F_WRLCK,SEEK_SET,0,0,0};
: static const struct flock lck_clr={F_UNLCK,SEEK_SET,0,0,0};
: ...................
转信站: BYR!news.happynet.org!news.neu.edu.cn!news.newsmth.net!NEWSMTH
你 up 一下吧, 这地方当初没多想...
【 在 kaman (天外飞仙) 的大作中提到: 】
: 里面不能这样初始化吧?
: static const struct flock lck_set={F_WRLCK,SEEK_SET,0,0,0};
: static const struct flock lck_clr={F_UNLCK,SEEK_SET,0,0,0};
: ...................