Exemple #1
0
/*override system glibc implementation */
int fcntl(int fd, int cmd, ... /* arg */ ){
    int ret=0;
    LOG_SYSCALL_START("fd=%d cmd=%d", fd, cmd);
    errno=0;

    struct MountsInterface* transpar_mount = transparent_mount();
    assert(transpar_mount);

    va_list args;
    va_start(args, cmd);
    if ( cmd == F_SETLK || cmd == F_SETLKW || cmd == F_GETLK ){
	struct flock* input_lock = va_arg(args, struct flock*);
	ZRT_LOG(L_SHORT, "flock=%p", input_lock );
	ret = transpar_mount->fcntl(fd, cmd, input_lock);
    }
    va_end(args);
    LOG_SYSCALL_FINISH(ret, "fd=%d, cmd=%s", fd, STR_FCNTL_CMD(cmd));
    return ret;
}
static int fuse_operations_mount_fcntl(struct MountsPublicInterface* this_, int fd, int cmd, ...) {
    ZRT_LOG(L_INFO, "cmd=%s", STR_FCNTL_CMD(cmd));
    SET_ERRNO(ENOSYS);
    return -1;
}