楼主说的对,感觉还是有问题,各平台不同是正确的,但Linux上应该是c_short,在li
nux的头文件里:
#ifndef F_RDLCK
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
# define F_RDLCK 0 /* Read lock. */
# define F_WRLCK 1 /* Write lock. */
# define F_UNLCK 2 /* Remove lock. */
#endif
而fcntl手册里说它们是给l_type使用的,它是一个short:
short l_type; /* Type of lock: F_RDLCK,
F_WRLCK, F_UNLCK */
所以,Linux平台应该是c_short而不是c_int才对
: mac 和 bsd 也可以用 as _ 转,代码是一样的,不会报错
: rust libc库只是如实把C libc库转到rust,它本来就是各平台会有不同。
--
修改:gameplayer FROM 222.128.5.*
FROM 222.128.5.*