本文整理汇总了C++中FS_CALL函数的典型用法代码示例。如果您正苦于以下问题:C++ FS_CALL函数的具体用法?C++ FS_CALL怎么用?C++ FS_CALL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FS_CALL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IO
virtual status_t IO(off_t offset, void* buffer, size_t* length)
{
iovec vec;
vec.iov_base = buffer;
vec.iov_len = *length;
if (fWrite) {
return FS_CALL(fVnode, write_pages, fCookie, offset, &vec, 1,
length);
}
return FS_CALL(fVnode, read_pages, fCookie, offset, &vec, 1, length);
}
示例2: luv_fs_write
static int luv_fs_write(lua_State* L) {
uv_file file = luaL_checkinteger(L, 1);
uv_buf_t buf;
int64_t offset;
int ref;
uv_fs_t* req;
size_t count;
uv_buf_t *bufs = NULL;
if (lua_istable(L, 2)) {
bufs = luv_prep_bufs(L, 2, &count);
}
else if (lua_isstring(L, 2)) {
luv_check_buf(L, 2, &buf);
count = 1;
}
else {
return luaL_argerror(L, 2, "data must be string or table of strings");
}
offset = luaL_checkinteger(L, 3);
ref = luv_check_continuation(L, 4);
req = lua_newuserdata(L, sizeof(*req));
req->data = luv_setup_req(L, ref);
req->ptr = buf.base;
((luv_req_t*)req->data)->data = bufs;
FS_CALL(write, req, file, bufs ? bufs : &buf, count, offset);
}
示例3: luv_fs_symlink
int luv_fs_symlink(lua_State* L) {
const char* path = luaL_checkstring(L, 1);
const char* new_path = luaL_checkstring(L, 2);
int flags = luv_string_to_flags(L, luaL_checkstring(L, 3));
uv_fs_t* req = luv_fs_store_callback(L, 4);
FS_CALL(symlink, 4, new_path, path, new_path, flags);
}
示例4: luv_fs_chown
int luv_fs_chown(lua_State* L) {
const char* path = luaL_checkstring(L, 1);
int uid = luaL_checkint(L, 2);
int gid = luaL_checkint(L, 3);
uv_fs_t* req = luv_fs_store_callback(L, 4);
FS_CALL(chown, 4, path, path, uid, gid);
}
示例5: luv_fs_mkdtemp
static int luv_fs_mkdtemp(lua_State* L) {
const char* tpl = luaL_checkstring(L, 1);
int ref = luv_check_continuation(L, 2);
uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
req->data = luv_setup_req(L, ref);
FS_CALL(mkdtemp, req, tpl);
}
示例6: luv_fs_futime
int luv_fs_futime(lua_State* L) {
uv_file file = luaL_checkint(L, 1);
double atime = luaL_checknumber(L, 2);
double mtime = luaL_checknumber(L, 3);
uv_fs_t* req = luv_fs_store_callback(L, 4);
FS_CALL(futime, 4, NULL, file, atime, mtime);
}
示例7: luv_fs_open
int luv_fs_open(lua_State* L) {
const char* path = luaL_checkstring(L, 1);
int flags = luv_string_to_flags(L, luaL_checkstring(L, 2));
int mode = luaL_checkint(L, 3);
uv_fs_t* req = luv_fs_store_callback(L, 4);
FS_CALL(open, 4, path, path, flags, mode);
}
示例8: luv_fs_fchown
int luv_fs_fchown(lua_State* L) {
uv_file file = luaL_checkint(L, 1);
int uid = luaL_checkint(L, 2);
int gid = luaL_checkint(L, 3);
uv_fs_t* req = luv_fs_store_callback(L, 4);
FS_CALL(fchown, 4, NULL, file, uid, gid);
}
示例9: luv_fs_readlink
static int luv_fs_readlink(lua_State* L) {
const char* path = luaL_checkstring(L, 1);
int ref = luv_check_continuation(L, 2);
uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
req->data = luv_setup_req(L, ref);
FS_CALL(readlink, req, path);
}
示例10: luv_fs_utime
int luv_fs_utime(lua_State* L) {
const char* path = luaL_checkstring(L, 1);
double atime = luaL_checknumber(L, 2);
double mtime = luaL_checknumber(L, 3);
uv_fs_t* req = luv_fs_store_callback(L, 4);
FS_CALL(utime, 4, path, path, atime, mtime);
}
示例11: luv_fs_fdatasync
static int luv_fs_fdatasync(lua_State* L) {
uv_file file = luaL_checkinteger(L, 1);
int ref = luv_check_continuation(L, 2);
uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
req->data = luv_setup_req(L, ref);
FS_CALL(fdatasync, req, file);
}
示例12: luv_fs_write
int luv_fs_write(lua_State* L) {
uv_file file = luaL_checkint(L, 1);
off_t offset = luaL_checkint(L, 2);
size_t length;
void* chunk = (void*)luaL_checklstring(L, 3, &length);
uv_fs_t* req = luv_fs_store_callback(L, 4);
FS_CALL(write, 4, NULL, file, chunk, length, offset);
}
示例13: luv_fs_chmod
static int luv_fs_chmod(lua_State* L) {
const char* path = luaL_checkstring(L, 1);
int mode = luaL_checkinteger(L, 2);
int ref = luv_check_continuation(L, 3);
uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
req->data = luv_setup_req(L, ref);
FS_CALL(chmod, req, path, mode);
}
示例14: luv_fs_access
static int luv_fs_access(lua_State* L) {
const char* path = luaL_checkstring(L, 1);
int amode = luv_check_amode(L, 2);
int ref = luv_check_continuation(L, 3);
uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
req->data = luv_setup_req(L, ref);
FS_CALL(access, req, path, amode);
}
示例15: luv_fs_sendfile
int luv_fs_sendfile(lua_State* L) {
uv_file out_fd = luaL_checkint(L, 1);
uv_file in_fd = luaL_checkint(L, 2);
off_t in_offset = luaL_checkint(L, 3);
size_t length = luaL_checkint(L, 4);
uv_fs_t* req = luv_fs_store_callback(L, 5);
FS_CALL(sendfile, 5, NULL, out_fd, in_fd, in_offset, length);
}