From bcad1a6f22662ff0d04a6ae417adb30550252d97 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Sun, 9 Oct 2016 19:50:51 -0700 Subject: Renamed ioctl and poll examples The new names should make it more obvious at first glance what each example demonstrates. --- example/fioclient.c | 72 ----------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 example/fioclient.c (limited to 'example/fioclient.c') diff --git a/example/fioclient.c b/example/fioclient.c deleted file mode 100644 index 704f24b..0000000 --- a/example/fioclient.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - FUSE fioclient: FUSE ioctl example client - Copyright (C) 2008 SUSE Linux Products GmbH - Copyright (C) 2008 Tejun Heo - - This program can be distributed under the terms of the GNU GPL. - See the file COPYING. -*/ - -/** @file - * @tableofcontents - * - * fioclient.c - FUSE fioclient: FUSE ioctl example client - * - * \section section_compile compiling this example - * - * gcc -Wall fioclient.c -o fioclient - * - * \section section_source the complete source - * fioclient.c - * \include fioclient.c - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include "fioc.h" - -const char *usage = -"Usage: fioclient FIOC_FILE [size]\n" -"\n" -"Get size if 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; -} -- cgit v1.2.3