git.samba.org
/
tridge
/
junkcode.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
fixed instructions
[tridge/junkcode.git]
/
lseek.c
1
#include <stdio.h>
2
#include <unistd.h>
3
#include <stdlib.h>
4
#include <linux/inotify.h>
5
#include <errno.h>
6
#include <asm/unistd.h>
7
#include <sys/types.h>
8
#include <sys/stat.h>
9
#include <fcntl.h>
10
#include <signal.h>
11
12
int main(void)
13
{
14
int fd = open("xx.dat", O_CREAT, 0666);
15
16
if (fork() == 0) {
17
lseek(fd, 10, SEEK_SET);
18
_exit(0);
19
}
20
21
printf("ofs %d\n", lseek(fd, 0, SEEK_CUR));
22
return 0;
23
}