1 .TH lustreapi 3 "2023 Mar 22" Lustre user application interface library
3 llapi_ioctl \- call ioctl() with possible command remapping
6 .B #include <lustre/lustreapi.h>
8 .BI "int llapi_ioctl(int " fd ", unsigned int " cmd ", void *" buf ");"
14 system call with the supplied arguments. However, if the ioctl() returns
16 (no such ioctl) then if
18 has been remapped from an older ioctl command number the ioctl() call will
19 be retried with the old ioctl command number.
26 on success in most cases
29 a negative value on failure and sets
31 Due to the variety of ioctl commands, it may return different values
32 and errno as appropriate for the
40 #include <lustre/lustreapi.h>
42 int main(int argc, char *argv[])
44 unsigned long group = 1234;
47 fd = open(argv[1], O_RDONLY);
49 fprintf(stderr, "error opening file '%s': %s\\n",
50 argv[1], strerror(errno));
54 rc = llapi_ioctl(fd, LL_IOC_GROUP_LOCK, &group);
56 fprintf(stderr, "%s: ioctl error: %s\\n",
57 argv[1], strerror(errno));
61 printf("%s: locked with group %lu\\n", argv[1], group);