io_getevents.2, ioctl_fat.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-08-16 11:09:48 +02:00
parent 58c2a94b64
commit 18ef2552b1
2 changed files with 22 additions and 21 deletions

View File

@ -32,12 +32,12 @@ The \fItimeout\fP argument specifies the amount of time to wait for events,
and is specified as a relative timeout in a structure of the following form:
.PP
.in +4n
.nf
.EX
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds [0 .. 999999999] */
};
.fi
.EE
.in
.PP
The specified time will be rounded up to the system clock granularity

View File

@ -110,9 +110,9 @@ Typically the volume ID is displayed to the user as a group of two
16-bit fields:
.PP
.in +4n
.nf
.EX
printf("Volume ID %04x-%04x\\n", id >> 16, id & 0xFFFF);
.fi
.EE
.in
.SS Reading short file names of a directory
A file or directory on a FAT filesystem always has a short filename
@ -144,14 +144,14 @@ The
argument is a two-element array of the following structures:
.PP
.in +4n
.nf
.EX
struct __fat_dirent {
long d_ino;
__kernel_off_t d_off;
uint32_t short d_reclen;
char d_name[256];
};
.fi
.EE
.in
.PP
The first entry in the array is for the short filename.
@ -256,16 +256,16 @@ The following was recorded when applying the program for the file
.IR /mnt/user/foo :
.PP
.in +4n
.nf
.EX
# ./toggle_fat_archive_flag /mnt/user/foo
Archive flag is set
Toggling archive flag
Archive flag is not set
.fi
.EE
.in
.SS Program source (toggle_fat_archive_flag.c)
.in +4n
.nf
\&
.EX
#include <fcntl.h>
#include <linux/msdos_fs.h>
#include <stdint.h>
@ -345,8 +345,8 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
.fi
.in
.EE
.\"
.SS Reading the volume ID
The following program demonstrates the use of
.BR ioctl (2)
@ -357,14 +357,14 @@ directory
.IR /mnt/user :
.PP
.in +4n
.nf
.EX
$ ./display_fat_volume_id /mnt/user
Volume ID 6443-6241
.fi
.EE
.in
.SS Program source (display_fat_volume_id.c)
.in +4n
.nf
\&
.EX
#include <fcntl.h>
#include <linux/msdos_fs.h>
#include <stdint.h>
@ -409,8 +409,8 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
.fi
.in
.EE
.\"
.SS Listing a directory
The following program demonstrates the use of
.BR ioctl (2)
@ -420,15 +420,16 @@ The following was recorded when applying the program to the directory
.IR /mnt/user :
.PP
.in +4n
.nf
$ ./fat_dir /mnt/user
.EX
$ \fB./fat_dir /mnt/user\fP
\[char46] -> ''
\[char46]. -> ''
ALONGF~1.TXT -> 'a long filename.txt'
UPPER.TXT -> ''
LOWER.TXT -> 'lower.txt'
.fi
.EE
.in
.\"
.SS Program source
.in +4n
.EX