diff options
author | Paul Lawrence <paullawrence@google.com> | 2019-08-02 16:45:27 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-08-02 16:45:27 -0700 |
commit | 1ca65fd045ff0aad723cfb4c740ee9250ae5c360 (patch) | |
tree | eb415748db51aed7c3d08a5e7dae57c8576ea940 /example/ioctl_client.c | |
parent | be83b553fef2fa13ecc8edbea974f450637cc60e (diff) | |
parent | c77441c6bcfb18dd3c887cdf24a778960fbe0c41 (diff) |
Remove GPL files am: 94aa887ced am: b4099f5e0f am: 2609a900fb
am: c77441c6bc
Change-Id: I849d56bb6f9909131b449f4f472f21aabd6d2aeb
Diffstat (limited to 'example/ioctl_client.c')
-rw-r--r-- | example/ioctl_client.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/example/ioctl_client.c b/example/ioctl_client.c deleted file mode 100644 index f1878fb..0000000 --- a/example/ioctl_client.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - FUSE fioclient: FUSE ioctl example client - Copyright (C) 2008 SUSE Linux Products GmbH - Copyright (C) 2008 Tejun Heo <teheo@suse.de> - - This program tests the ioctl.c example file systsem. - - This program can be distributed under the terms of the GNU GPL. - See the file COPYING. -*/ - -/** @file - * - * This program tests the ioctl.c example file systsem. - * - * Compile with: - * - * gcc -Wall ioctl_client.c -o ioctl_client - * - * ## Source code ## - * \include ioctl_client.c - */ - -#include <sys/types.h> -#include <fcntl.h> -#include <sys/stat.h> -#include <sys/ioctl.h> -#include <stdio.h> -#include <stdlib.h> -#include <ctype.h> -#include <errno.h> -#include "ioctl.h" - -const char *usage = -"Usage: fioclient FIOC_FILE [size]\n" -"\n" -"Get size if <size> is omitted, set size otherwise\n" -"\n"; - -int main(int argc, char **argv) -{ - size_t size; - int fd; - - if (argc < 2) { - fprintf(stderr, "%s", usage); - return 1; - } - - fd = open(argv[1], O_RDWR); - if (fd < 0) { - perror("open"); - return 1; - } - - if (argc == 2) { - if (ioctl(fd, FIOC_GET_SIZE, &size)) { - perror("ioctl"); - return 1; - } - printf("%zu\n", size); - } else { - size = strtoul(argv[2], NULL, 0); - if (ioctl(fd, FIOC_SET_SIZE, &size)) { - perror("ioctl"); - return 1; - } - } - return 0; -} |