j***g 发帖数: 19 | 2 1 int
2 delete_range(filename,id1,id2)
3 char *filename ;
4 int id1,id2 ;
5 {
6 struct fileheader fhdr;
7 char tmpfile[ STRLEN ], deleted[ STRLEN ];
8 int fdr, fdw, fd;
9 int count;
10
11 tmpfilename( filename, tmpfile, deleted );
12 if((fd = open(".dellock",O_RDWR|O_CREAT|O_APPEND, 0644)) == -1)
13 return -1;
14 flock(fd,LOCK_EX);
15
16 if((fdr |
|