ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libeio/eio.c
(Generate patch)

Comparing libeio/eio.c (file contents):
Revision 1.118 by root, Mon Apr 2 17:53:27 2012 UTC vs.
Revision 1.120 by root, Tue Apr 24 18:47:50 2012 UTC

1032 int res; 1032 int res;
1033 1033
1034#if HAVE_SYS_SYNCFS 1034#if HAVE_SYS_SYNCFS
1035 res = (int)syscall (__NR_syncfs, (int)(fd)); 1035 res = (int)syscall (__NR_syncfs, (int)(fd));
1036#else 1036#else
1037 res = -1; 1037 res = EIO_ENOSYS ();
1038 errno = ENOSYS;
1039#endif 1038#endif
1040 1039
1041 if (res < 0 && errno == ENOSYS && fd >= 0) 1040 if (res < 0 && errno == ENOSYS && fd >= 0)
1042 sync (); 1041 sync ();
1043 1042
1073} 1072}
1074 1073
1075static int 1074static int
1076eio__fallocate (int fd, int mode, off_t offset, size_t len) 1075eio__fallocate (int fd, int mode, off_t offset, size_t len)
1077{ 1076{
1078#if HAVE_FALLOCATE 1077#if HAVE_LINUX_FALLOCATE
1079 return fallocate (fd, mode, offset, len); 1078 return fallocate (fd, mode, offset, len);
1080#else 1079#else
1081 errno = ENOSYS; 1080 return EIO_ENOSYS ();
1082 return -1;
1083#endif 1081#endif
1084} 1082}
1085 1083
1086#if !HAVE_READAHEAD 1084#if !HAVE_READAHEAD
1087# undef readahead 1085# undef readahead
1186 HANDLE h = TO_SOCKET (ifd); 1184 HANDLE h = TO_SOCKET (ifd);
1187 SetFilePointer (h, offset, 0, FILE_BEGIN); 1185 SetFilePointer (h, offset, 0, FILE_BEGIN);
1188 res = TransmitFile (TO_SOCKET (ofd), h, count, 0, 0, 0, 0); 1186 res = TransmitFile (TO_SOCKET (ofd), h, count, 0, 0, 0, 0);
1189 1187
1190#else 1188#else
1191 res = -1; 1189 res = EIO_ENOSYS ();
1192 errno = ENOSYS;
1193#endif 1190#endif
1194 1191
1195 /* we assume sendfile can copy at least 128mb in one go */ 1192 /* we assume sendfile can copy at least 128mb in one go */
1196 if (res <= 128 * 1024 * 1024) 1193 if (res <= 128 * 1024 * 1024)
1197 { 1194 {
2243 free (req); 2240 free (req);
2244 2241
2245 X_LOCK (wrklock); 2242 X_LOCK (wrklock);
2246 etp_worker_free (self); 2243 etp_worker_free (self);
2247 X_UNLOCK (wrklock); 2244 X_UNLOCK (wrklock);
2248
2249 return 0;
2250} 2245}
2251 2246
2252/*****************************************************************************/ 2247/*****************************************************************************/
2253 2248
2254int ecb_cold 2249int ecb_cold
2495 case EIO_CUSTOM: 2490 case EIO_CUSTOM:
2496 req->feed (req); 2491 req->feed (req);
2497 break; 2492 break;
2498 2493
2499 default: 2494 default:
2500 errno = ENOSYS;
2501 req->result = -1; 2495 req->result = EIO_ENOSYS ();
2502 break; 2496 break;
2503 } 2497 }
2504 2498
2505 req->errorno = errno; 2499 req->errorno = errno;
2506} 2500}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines