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

Comparing libeio/eio.c (file contents):
Revision 1.143 by root, Sat Dec 3 16:33:46 2016 UTC vs.
Revision 1.146 by root, Sat Jan 6 01:04:43 2018 UTC

1/* 1/*
2 * libeio implementation 2 * libeio implementation
3 * 3 *
4 * Copyright (c) 2007,2008,2009,2010,2011,2012,2013,2016 Marc Alexander Lehmann <libeio@schmorp.de> 4 * Copyright (c) 2007,2008,2009,2010,2011,2012,2013,2016,2017 Marc Alexander Lehmann <libeio@schmorp.de>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without modifica- 7 * Redistribution and use in source and binary forms, with or without modifica-
8 * tion, are permitted provided that the following conditions are met: 8 * tion, are permitted provided that the following conditions are met:
9 * 9 *
231 #define D_NAME(entp) entp.cFileName 231 #define D_NAME(entp) entp.cFileName
232 #define D_TYPE(entp) (entp.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ? DT_DIR : DT_REG) 232 #define D_TYPE(entp) (entp.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ? DT_DIR : DT_REG)
233 233
234#else 234#else
235 235
236 #include <sys/ioctl.h>
236 #include <sys/time.h> 237 #include <sys/time.h>
237 #include <sys/select.h> 238 #include <sys/select.h>
238 #include <unistd.h> 239 #include <unistd.h>
239 #include <signal.h> 240 #include <signal.h>
240 #include <dirent.h> 241 #include <dirent.h>
299# else 300# else
300# error sendfile support requested but not available 301# error sendfile support requested but not available
301# endif 302# endif
302#endif 303#endif
303 304
305#if HAVE_RENAMEAT2
306# include <sys/syscall.h>
307# include <linux/fs.h>
308#endif
309
304#ifndef D_TYPE 310#ifndef D_TYPE
305# define D_TYPE(de) 0 311# define D_TYPE(de) 0
306#endif 312#endif
307#ifndef D_INO 313#ifndef D_INO
308# define D_INO(de) 0 314# define D_INO(de) 0
316# define NAME_MAX 4096 322# define NAME_MAX 4096
317#endif 323#endif
318 324
319/* used for readlink etc. */ 325/* used for readlink etc. */
320#ifndef PATH_MAX 326#ifndef PATH_MAX
321# define PATH_MAX 4096 327# define PATH_MAX 0
322#endif 328#endif
329
330#ifndef EIO_PATH_MIN
331# define EIO_PATH_MIN 8160
332#endif
333
334#define EIO_PATH_MAX (PATH_MAX <= EIO_PATH_MIN ? EIO_PATH_MIN : PATH_MAX)
323 335
324/* buffer size for various temporary buffers */ 336/* buffer size for various temporary buffers */
325#define EIO_BUFSIZE 65536 337#define EIO_BUFSIZE 65536
326 338
327#define dBUF \ 339#define dBUF \
541} 553}
542 554
543/*****************************************************************************/ 555/*****************************************************************************/
544/* work around various missing functions */ 556/* work around various missing functions */
545 557
558#if HAVE_POSIX_CLOSE && !__linux
559# define eio__close(fd) posix_close (fd, 0)
560#else
561# define eio__close(fd) close (fd)
562#endif
563
564/* close() without disturbing errno */
565static void
566silent_close (int fd)
567{
568 int saved_errno = errno;
569 eio__close (fd);
570 errno = saved_errno;
571}
572
546#ifndef HAVE_UTIMES 573#ifndef HAVE_UTIMES
547 574
548# undef utimes 575# undef utimes
549# define utimes(path,times) eio__utimes (path, times) 576# define utimes(path,times) eio__utimes (path, times)
550 577
974 1001
975 errno = ENOENT; 1002 errno = ENOENT;
976 if (!*rel) 1003 if (!*rel)
977 return -1; 1004 return -1;
978 1005
979 res = etp_tmpbuf_get (tmpbuf, PATH_MAX * 3); 1006 res = etp_tmpbuf_get (tmpbuf, EIO_PATH_MAX * 3);
980#ifdef _WIN32 1007#ifdef _WIN32
981 if (_access (rel, 4) != 0) 1008 if (_access (rel, 4) != 0)
982 return -1; 1009 return -1;
983 1010
984 symlinks = GetFullPathName (rel, PATH_MAX * 3, res, 0); 1011 symlinks = GetFullPathName (rel, EIO_PATH_MAX * 3, res, 0);
985 1012
986 errno = ENAMETOOLONG; 1013 errno = ENAMETOOLONG;
987 if (symlinks >= PATH_MAX * 3) 1014 if (symlinks >= EIO_PATH_MAX * 3)
988 return -1; 1015 return -1;
989 1016
990 errno = EIO; 1017 errno = EIO;
991 if (symlinks <= 0) 1018 if (symlinks <= 0)
992 return -1; 1019 return -1;
993 1020
994 return symlinks; 1021 return symlinks;
995 1022
996#else 1023#else
997 tmp1 = res + PATH_MAX; 1024 tmp1 = res + EIO_PATH_MAX;
998 tmp2 = tmp1 + PATH_MAX; 1025 tmp2 = tmp1 + EIO_PATH_MAX;
999 1026
1000#if 0 /* disabled, the musl way to do things is just too racy */ 1027#if 0 /* disabled, the musl way to do things is just too racy */
1001#if __linux && defined(O_NONBLOCK) && defined(O_NOATIME) 1028#if __linux && defined(O_NONBLOCK) && defined(O_NOATIME)
1002 /* on linux we may be able to ask the kernel */ 1029 /* on linux we may be able to ask the kernel */
1003 { 1030 {
1004 int fd = open (rel, O_RDONLY | O_NONBLOCK | O_NOCTTY | O_NOATIME); 1031 int fd = open (rel, O_RDONLY | O_NONBLOCK | O_NOCTTY | O_NOATIME);
1005 1032
1006 if (fd >= 0) 1033 if (fd >= 0)
1007 { 1034 {
1008 sprintf (tmp1, "/proc/self/fd/%d", fd); 1035 sprintf (tmp1, "/proc/self/fd/%d", fd);
1009 req->result = readlink (tmp1, res, PATH_MAX); 1036 req->result = readlink (tmp1, res, EIO_PATH_MAX);
1010 /* here we should probably stat the open file and the disk file, to make sure they still match */ 1037 /* here we should probably stat the open file and the disk file, to make sure they still match */
1011 close (fd); 1038 eio__close (fd);
1012 1039
1013 if (req->result > 0) 1040 if (req->result > 0)
1014 goto done; 1041 goto done;
1015 } 1042 }
1016 else if (errno == ELOOP || errno == ENAMETOOLONG || errno == ENOENT || errno == ENOTDIR || errno == EIO) 1043 else if (errno == ELOOP || errno == ENAMETOOLONG || errno == ENOENT || errno == ENOTDIR || errno == EIO)
1027 if (wd == EIO_INVALID_WD) 1054 if (wd == EIO_INVALID_WD)
1028 return -1; 1055 return -1;
1029 1056
1030 if (wd == EIO_CWD) 1057 if (wd == EIO_CWD)
1031 { 1058 {
1032 if (!getcwd (res, PATH_MAX)) 1059 if (!getcwd (res, EIO_PATH_MAX))
1033 return -1; 1060 return -1;
1034 1061
1035 len = strlen (res); 1062 len = strlen (res);
1036 } 1063 }
1037 else 1064 else
1084 1111
1085 /* zero-terminate, for readlink */ 1112 /* zero-terminate, for readlink */
1086 res [len + 1] = 0; 1113 res [len + 1] = 0;
1087 1114
1088 /* now check if it's a symlink */ 1115 /* now check if it's a symlink */
1089 linklen = readlink (tmpbuf->ptr, tmp1, PATH_MAX); 1116 linklen = readlink (tmpbuf->ptr, tmp1, EIO_PATH_MAX);
1090 1117
1091 if (linklen < 0) 1118 if (linklen < 0)
1092 { 1119 {
1093 if (errno != EINVAL) 1120 if (errno != EINVAL)
1094 return -1; 1121 return -1;
1100 { 1127 {
1101 /* yay, it was a symlink - build new path in tmp2 */ 1128 /* yay, it was a symlink - build new path in tmp2 */
1102 int rellen = strlen (rel); 1129 int rellen = strlen (rel);
1103 1130
1104 errno = ENAMETOOLONG; 1131 errno = ENAMETOOLONG;
1105 if (linklen + 1 + rellen >= PATH_MAX) 1132 if (linklen + 1 + rellen >= EIO_PATH_MAX) /* also catch linklen >= EIO_PATH_MAX */
1106 return -1; 1133 return -1;
1107 1134
1108 errno = ELOOP; 1135 errno = ELOOP;
1109 if (!--symlinks) 1136 if (!--symlinks)
1110 return -1; 1137 return -1;
1374 return; 1401 return;
1375 1402
1376 dirp = fdopendir (fd); 1403 dirp = fdopendir (fd);
1377 1404
1378 if (!dirp) 1405 if (!dirp)
1379 close (fd); 1406 silent_close (fd);
1380 } 1407 }
1381 else 1408 else
1382 dirp = opendir (req->ptr1); 1409 dirp = opendir (req->ptr1);
1383 #else 1410 #else
1384 dirp = opendir (wd_expand (&self->tmpbuf, req->wd, req->ptr1)); 1411 dirp = opendir (wd_expand (&self->tmpbuf, req->wd, req->ptr1));
1663eio_wd_close_sync (eio_wd wd) 1690eio_wd_close_sync (eio_wd wd)
1664{ 1691{
1665 if (wd != EIO_INVALID_WD && wd != EIO_CWD) 1692 if (wd != EIO_INVALID_WD && wd != EIO_CWD)
1666 { 1693 {
1667 #if HAVE_AT 1694 #if HAVE_AT
1668 close (wd->fd); 1695 eio__close (wd->fd);
1669 #endif 1696 #endif
1670 free (wd); 1697 free (wd);
1671 } 1698 }
1672} 1699}
1673 1700
1674#if HAVE_AT 1701#if HAVE_AT
1675 1702
1703static int
1704eio__renameat2 (int olddirfd, const char *oldpath, int newdirfd, const char *newpath, unsigned int flags)
1705{
1706#if HAVE_RENAMEAT2
1707 return syscall (SYS_renameat2, olddirfd, oldpath, newdirfd, newpath, flags);
1708#else
1709 if (flags)
1710 return EIO_ENOSYS ();
1711
1712 return renameat (olddirfd, oldpath, newdirfd, newpath);
1713#endif
1714}
1715
1676/* they forgot these */ 1716/* they forgot these */
1677 1717
1678static int 1718static int
1679eio__truncateat (int dirfd, const char *path, off_t length) 1719eio__truncateat (int dirfd, const char *path, off_t length)
1680{ 1720{
1683 1723
1684 if (fd < 0) 1724 if (fd < 0)
1685 return fd; 1725 return fd;
1686 1726
1687 res = ftruncate (fd, length); 1727 res = ftruncate (fd, length);
1688 close (fd); 1728 silent_close (fd);
1689 return res; 1729 return res;
1690} 1730}
1691 1731
1692static int 1732static int
1693eio__statvfsat (int dirfd, const char *path, struct statvfs *buf) 1733eio__statvfsat (int dirfd, const char *path, struct statvfs *buf)
1697 1737
1698 if (fd < 0) 1738 if (fd < 0)
1699 return fd; 1739 return fd;
1700 1740
1701 res = fstatvfs (fd, buf); 1741 res = fstatvfs (fd, buf);
1702 close (fd); 1742 silent_close (fd);
1703 return res; 1743 return res;
1704
1705} 1744}
1706 1745
1707#endif 1746#endif
1708 1747
1709/*****************************************************************************/ 1748/*****************************************************************************/
1717 req->ptr2 = malloc (len); \ 1756 req->ptr2 = malloc (len); \
1718 if (!req->ptr2) \ 1757 if (!req->ptr2) \
1719 { \ 1758 { \
1720 errno = ENOMEM; \ 1759 errno = ENOMEM; \
1721 req->result = -1; \ 1760 req->result = -1; \
1722 break; \ 1761 goto alloc_fail; \
1723 } \ 1762 } \
1724 } 1763 }
1725 1764
1726/*****************************************************************************/ 1765/*****************************************************************************/
1766
1767static void
1768eio__slurp (int fd, eio_req *req)
1769{
1770 req->result = fd;
1771
1772 if (fd < 0)
1773 return;
1774
1775 if (req->offs < 0 || !req->size) /* do we need the size? */
1776 {
1777 off_t size = lseek (fd, 0, SEEK_END);
1778
1779 if (req->offs < 0)
1780 req->offs += size;
1781
1782 if (!req->size)
1783 req->size = size - req->offs;
1784 }
1785
1786 ALLOC (req->size);
1787 req->result = pread (fd, req->ptr2, req->size, req->offs);
1788
1789 silent_close (fd);
1790
1791alloc_fail:
1792 ;
1793}
1727 1794
1728int ecb_cold 1795int ecb_cold
1729eio_init (void (*want_poll)(void), void (*done_poll)(void)) 1796eio_init (void (*want_poll)(void), void (*done_poll)(void))
1730{ 1797{
1731 eio_want_poll_cb = want_poll; 1798 eio_want_poll_cb = want_poll;
1829 req->result = fstatat (dirfd, req->ptr1, (EIO_STRUCT_STAT *)req->ptr2, AT_SYMLINK_NOFOLLOW); break; 1896 req->result = fstatat (dirfd, req->ptr1, (EIO_STRUCT_STAT *)req->ptr2, AT_SYMLINK_NOFOLLOW); break;
1830 case EIO_CHOWN: req->result = fchownat (dirfd, req->ptr1, req->int2, req->int3, 0); break; 1897 case EIO_CHOWN: req->result = fchownat (dirfd, req->ptr1, req->int2, req->int3, 0); break;
1831 case EIO_CHMOD: req->result = fchmodat (dirfd, req->ptr1, (mode_t)req->int2, 0); break; 1898 case EIO_CHMOD: req->result = fchmodat (dirfd, req->ptr1, (mode_t)req->int2, 0); break;
1832 case EIO_TRUNCATE: req->result = eio__truncateat (dirfd, req->ptr1, req->offs); break; 1899 case EIO_TRUNCATE: req->result = eio__truncateat (dirfd, req->ptr1, req->offs); break;
1833 case EIO_OPEN: req->result = openat (dirfd, req->ptr1, req->int1, (mode_t)req->int2); break; 1900 case EIO_OPEN: req->result = openat (dirfd, req->ptr1, req->int1, (mode_t)req->int2); break;
1901 case EIO_SLURP: eio__slurp ( openat (dirfd, req->ptr1, O_RDONLY | O_CLOEXEC), req); break;
1834 1902
1835 case EIO_UNLINK: req->result = unlinkat (dirfd, req->ptr1, 0); break; 1903 case EIO_UNLINK: req->result = unlinkat (dirfd, req->ptr1, 0); break;
1836 case EIO_RMDIR: /* complications arise because "." cannot be removed, so we might have to expand */ 1904 case EIO_RMDIR: /* complications arise because "." cannot be removed, so we might have to expand */
1837 req->result = req->wd && SINGLEDOT (req->ptr1) 1905 req->result = req->wd && SINGLEDOT (req->ptr1)
1838 ? rmdir (req->wd->str) 1906 ? rmdir (req->wd->str)
1839 : unlinkat (dirfd, req->ptr1, AT_REMOVEDIR); break; 1907 : unlinkat (dirfd, req->ptr1, AT_REMOVEDIR); break;
1840 case EIO_MKDIR: req->result = mkdirat (dirfd, req->ptr1, (mode_t)req->int2); break; 1908 case EIO_MKDIR: req->result = mkdirat (dirfd, req->ptr1, (mode_t)req->int2); break;
1909 case EIO_RENAME: req->result = eio__renameat2 (
1910 dirfd,
1841 case EIO_RENAME: /* complications arise because "." cannot be renamed, so we might have to expand */ 1911 /* complications arise because "." cannot be renamed, so we might have to expand */
1842 req->result = req->wd && SINGLEDOT (req->ptr1) 1912 req->wd && SINGLEDOT (req->ptr1) ? req->wd->str : req->ptr1,
1843 ? rename (req->wd->str, req->ptr2) 1913 WD2FD ((eio_wd)req->int3),
1844 : renameat (dirfd, req->ptr1, WD2FD ((eio_wd)req->int3), req->ptr2); break; 1914 req->ptr2,
1915 req->int2
1916 );
1917 break;
1845 case EIO_LINK: req->result = linkat (dirfd, req->ptr1, WD2FD ((eio_wd)req->int3), req->ptr2, 0); break; 1918 case EIO_LINK: req->result = linkat (dirfd, req->ptr1, WD2FD ((eio_wd)req->int3), req->ptr2, 0); break;
1846 case EIO_SYMLINK: req->result = symlinkat (req->ptr1, dirfd, req->ptr2); break; 1919 case EIO_SYMLINK: req->result = symlinkat (req->ptr1, dirfd, req->ptr2); break;
1847 case EIO_MKNOD: req->result = mknodat (dirfd, req->ptr1, (mode_t)req->int2, (dev_t)req->offs); break; 1920 case EIO_MKNOD: req->result = mknodat (dirfd, req->ptr1, (mode_t)req->int2, (dev_t)req->offs); break;
1848 case EIO_READLINK: ALLOC (PATH_MAX);
1849 req->result = readlinkat (dirfd, req->ptr1, req->ptr2, PATH_MAX); break;
1850 case EIO_STATVFS: ALLOC (sizeof (EIO_STRUCT_STATVFS)); 1921 case EIO_STATVFS: ALLOC (sizeof (EIO_STRUCT_STATVFS));
1851 req->result = eio__statvfsat (dirfd, req->ptr1, (EIO_STRUCT_STATVFS *)req->ptr2); break; 1922 req->result = eio__statvfsat (dirfd, req->ptr1, (EIO_STRUCT_STATVFS *)req->ptr2); break;
1923 case EIO_READLINK: ALLOC (EIO_PATH_MAX);
1924 req->result = readlinkat (dirfd, req->ptr1, req->ptr2, EIO_PATH_MAX);
1925 if (req->result == EIO_PATH_MAX)
1926 {
1927 req->result = -1;
1928 errno = ENAMETOOLONG;
1929 }
1930 break;
1852 case EIO_UTIME: 1931 case EIO_UTIME:
1853 case EIO_FUTIME: 1932 case EIO_FUTIME:
1854 { 1933 {
1855 struct timespec ts[2]; 1934 struct timespec ts[2];
1856 struct timespec *times; 1935 struct timespec *times;
1881 req->result = lstat (path , (EIO_STRUCT_STAT *)req->ptr2); break; 1960 req->result = lstat (path , (EIO_STRUCT_STAT *)req->ptr2); break;
1882 case EIO_CHOWN: req->result = chown (path , req->int2, req->int3); break; 1961 case EIO_CHOWN: req->result = chown (path , req->int2, req->int3); break;
1883 case EIO_CHMOD: req->result = chmod (path , (mode_t)req->int2); break; 1962 case EIO_CHMOD: req->result = chmod (path , (mode_t)req->int2); break;
1884 case EIO_TRUNCATE: req->result = truncate (path , req->offs); break; 1963 case EIO_TRUNCATE: req->result = truncate (path , req->offs); break;
1885 case EIO_OPEN: req->result = open (path , req->int1, (mode_t)req->int2); break; 1964 case EIO_OPEN: req->result = open (path , req->int1, (mode_t)req->int2); break;
1965 case EIO_SLURP: eio__slurp ( open (path , O_RDONLY | O_CLOEXEC), req); break;
1886 1966
1887 case EIO_UNLINK: req->result = unlink (path ); break; 1967 case EIO_UNLINK: req->result = unlink (path ); break;
1888 case EIO_RMDIR: req->result = rmdir (path ); break; 1968 case EIO_RMDIR: req->result = rmdir (path ); break;
1889 case EIO_MKDIR: req->result = mkdir (path , (mode_t)req->int2); break; 1969 case EIO_MKDIR: req->result = mkdir (path , (mode_t)req->int2); break;
1890 case EIO_RENAME: req->result = rename (path , req->ptr2); break; 1970 case EIO_RENAME: req->result = req->int2 ? EIO_ENOSYS () : rename (path, req->ptr2); break;
1891 case EIO_LINK: req->result = link (path , req->ptr2); break; 1971 case EIO_LINK: req->result = link (path , req->ptr2); break;
1892 case EIO_SYMLINK: req->result = symlink (path , req->ptr2); break; 1972 case EIO_SYMLINK: req->result = symlink (path , req->ptr2); break;
1893 case EIO_MKNOD: req->result = mknod (path , (mode_t)req->int2, (dev_t)req->offs); break; 1973 case EIO_MKNOD: req->result = mknod (path , (mode_t)req->int2, (dev_t)req->offs); break;
1894 case EIO_READLINK: ALLOC (PATH_MAX);
1895 req->result = readlink (path, req->ptr2, PATH_MAX); break;
1896 case EIO_STATVFS: ALLOC (sizeof (EIO_STRUCT_STATVFS)); 1974 case EIO_STATVFS: ALLOC (sizeof (EIO_STRUCT_STATVFS));
1897 req->result = statvfs (path , (EIO_STRUCT_STATVFS *)req->ptr2); break; 1975 req->result = statvfs (path , (EIO_STRUCT_STATVFS *)req->ptr2); break;
1976 case EIO_READLINK: ALLOC (EIO_PATH_MAX);
1977 req->result = readlink (path, req->ptr2, EIO_PATH_MAX);
1978 if (req->result == EIO_PATH_MAX)
1979 {
1980 req->result = -1;
1981 errno = ENAMETOOLONG;
1982 }
1983 break;
1898 1984
1899 case EIO_UTIME: 1985 case EIO_UTIME:
1900 case EIO_FUTIME: 1986 case EIO_FUTIME:
1901 { 1987 {
1902 struct timeval tv[2]; 1988 struct timeval tv[2];
1937 2023
1938 case EIO_FCHOWN: req->result = fchown (req->int1, req->int2, req->int3); break; 2024 case EIO_FCHOWN: req->result = fchown (req->int1, req->int2, req->int3); break;
1939 case EIO_FCHMOD: req->result = fchmod (req->int1, (mode_t)req->int2); break; 2025 case EIO_FCHMOD: req->result = fchmod (req->int1, (mode_t)req->int2); break;
1940 case EIO_FTRUNCATE: req->result = ftruncate (req->int1, req->offs); break; 2026 case EIO_FTRUNCATE: req->result = ftruncate (req->int1, req->offs); break;
1941 2027
1942 case EIO_CLOSE: req->result = close (req->int1); break; 2028 case EIO_CLOSE: req->result = eio__close (req->int1); break;
1943 case EIO_DUP2: req->result = dup2 (req->int1, req->int2); break; 2029 case EIO_DUP2: req->result = dup2 (req->int1, req->int2); break;
1944 case EIO_SYNC: req->result = 0; sync (); break; 2030 case EIO_SYNC: req->result = 0; sync (); break;
1945 case EIO_FSYNC: req->result = fsync (req->int1); break; 2031 case EIO_FSYNC: req->result = fsync (req->int1); break;
1946 case EIO_FDATASYNC: req->result = fdatasync (req->int1); break; 2032 case EIO_FDATASYNC: req->result = fdatasync (req->int1); break;
1947 case EIO_SYNCFS: req->result = eio__syncfs (req->int1); break; 2033 case EIO_SYNCFS: req->result = eio__syncfs (req->int1); break;
1985 default: 2071 default:
1986 req->result = EIO_ENOSYS (); 2072 req->result = EIO_ENOSYS ();
1987 break; 2073 break;
1988 } 2074 }
1989 2075
2076alloc_fail:
1990 req->errorno = errno; 2077 req->errorno = errno;
1991} 2078}
1992 2079
1993#ifndef EIO_NO_WRAPPERS 2080#ifndef EIO_NO_WRAPPERS
1994 2081
2247eio_req *eio_rename (const char *path, const char *new_path, int pri, eio_cb cb, void *data) 2334eio_req *eio_rename (const char *path, const char *new_path, int pri, eio_cb cb, void *data)
2248{ 2335{
2249 return eio__2path (EIO_RENAME, path, new_path, pri, cb, data); 2336 return eio__2path (EIO_RENAME, path, new_path, pri, cb, data);
2250} 2337}
2251 2338
2339eio_req *eio_slurp (const char *path, void *buf, ssize_t length, off_t offset, int pri, eio_cb cb, void *data)
2340{
2341 REQ (EIO_SLURP); PATH; req->offs = offset; req->size = length; req->ptr2 = buf; SEND;
2342}
2343
2252eio_req *eio_custom (void (*execute)(eio_req *), int pri, eio_cb cb, void *data) 2344eio_req *eio_custom (void (*execute)(eio_req *), int pri, eio_cb cb, void *data)
2253{ 2345{
2254 REQ (EIO_CUSTOM); req->feed = execute; SEND; 2346 REQ (EIO_CUSTOM); req->feed = execute; SEND;
2255} 2347}
2256 2348

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines