ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.xs
(Generate patch)

Comparing IO-AIO/AIO.xs (file contents):
Revision 1.169 by root, Wed Aug 4 16:06:54 2010 UTC vs.
Revision 1.176 by root, Thu Dec 2 10:04:47 2010 UTC

118 STRLEN stroffset; \ 118 STRLEN stroffset; \
119 SV *self; 119 SV *self;
120 120
121#define EIO_NO_WRAPPERS 1 121#define EIO_NO_WRAPPERS 1
122 122
123#include "libeio/config.h"
123#include "libeio/eio.h" 124#include "libeio/eio.h"
124 125
125#ifndef POSIX_FADV_NORMAL 126#ifndef POSIX_FADV_NORMAL
126# define POSIX_FADV_NORMAL 0 127# define POSIX_FADV_NORMAL 0
127# define NO_FADVISE 1
128#endif 128#endif
129#ifndef POSIX_FADV_SEQUENTIAL 129#ifndef POSIX_FADV_SEQUENTIAL
130# define POSIX_FADV_SEQUENTIAL 0 130# define POSIX_FADV_SEQUENTIAL 0
131#endif 131#endif
132#ifndef POSIX_FADV_RANDOM 132#ifndef POSIX_FADV_RANDOM
140#endif 140#endif
141#ifndef POSIX_FADV_DONTNEED 141#ifndef POSIX_FADV_DONTNEED
142# define POSIX_FADV_DONTNEED 0 142# define POSIX_FADV_DONTNEED 0
143#endif 143#endif
144 144
145#if !HAVE_POSIX_FADVISE
146# define posix_fadvise(a,b,c,d) errno = ENOSYS /* also return ENOSYS */
147#endif
148
145#ifndef POSIX_MADV_NORMAL 149#ifndef POSIX_MADV_NORMAL
146# define POSIX_MADV_NORMAL 0 150# define POSIX_MADV_NORMAL 0
147# define NO_MADVISE 1
148#endif 151#endif
149#ifndef POSIX_MADV_SEQUENTIAL 152#ifndef POSIX_MADV_SEQUENTIAL
150# define POSIX_MADV_SEQUENTIAL 0 153# define POSIX_MADV_SEQUENTIAL 0
151#endif 154#endif
152#ifndef POSIX_MADV_RANDOM 155#ifndef POSIX_MADV_RANDOM
157#endif 160#endif
158#ifndef POSIX_MADV_DONTNEED 161#ifndef POSIX_MADV_DONTNEED
159# define POSIX_MADV_DONTNEED 0 162# define POSIX_MADV_DONTNEED 0
160#endif 163#endif
161 164
165#if !HAVE_POSIX_MADVISE
166# define posix_madvise(a,b,c) errno = ENOSYS /* also return ENOSYS */
167#endif
168
169#ifndef PROT_NONE
170# define PROT_NONE 0
171#endif
172#ifndef PROT_READ
173# define PROT_READ 0
174#endif
175#ifndef PROT_WRITE
176# define PROT_READ 0
177#endif
178#ifndef PROT_EXEC
179# define PROT_EXEC 0
180#endif
181
162#ifndef ST_NODEV 182#ifndef ST_NODEV
163# define ST_NODEV 0 183# define ST_NODEV 0
164#endif 184#endif
165#ifndef ST_NOEXEC 185#ifndef ST_NOEXEC
166# define ST_NOEXEC 0 186# define ST_NOEXEC 0
186#ifndef ST_NODIRATIME 206#ifndef ST_NODIRATIME
187# define ST_NODIRATIME 0 207# define ST_NODIRATIME 0
188#endif 208#endif
189#ifndef ST_RELATIME 209#ifndef ST_RELATIME
190# define ST_RELATIME 0 210# define ST_RELATIME 0
191#endif
192
193#ifndef MCL_CURRENT
194# define MCL_CURRENT 0
195#endif
196#ifndef MCL_FUTURE
197# define MCL_FUTURE 0
198#endif 211#endif
199 212
200#ifndef MAP_ANONYMOUS 213#ifndef MAP_ANONYMOUS
201# ifdef MAP_ANON 214# ifdef MAP_ANON
202# define MAP_ANONYMOUS MAP_ANON 215# define MAP_ANONYMOUS MAP_ANON
623/*****************************************************************************/ 636/*****************************************************************************/
624 637
625#if !_POSIX_MAPPED_FILES 638#if !_POSIX_MAPPED_FILES
626# define mmap(addr,length,prot,flags,fd,offs) (errno = ENOSYS, -1) 639# define mmap(addr,length,prot,flags,fd,offs) (errno = ENOSYS, -1)
627# define munmap(addr,length) (errno = ENOSYS, -1) 640# define munmap(addr,length) (errno = ENOSYS, -1)
641# define mprotect(addr,len,prot) (errno = ENOSYS, -1)
642# define PROT_NONE 0
643# define PROT_WRITE 0
644# define MAP_PRIVATE 0
645# define MAP_SHARED 0
646# define MAP_FIXED 0
628#endif 647#endif
629 648
630#define MMAP_MAGIC PERL_MAGIC_ext 649#define MMAP_MAGIC PERL_MAGIC_ext
631 650
632static int 651static int
735 const_iv (ST_IMMUTABLE) 754 const_iv (ST_IMMUTABLE)
736 const_iv (ST_NOATIME) 755 const_iv (ST_NOATIME)
737 const_iv (ST_NODIRATIME) 756 const_iv (ST_NODIRATIME)
738 const_iv (ST_RELATIME) 757 const_iv (ST_RELATIME)
739 758
759 const_iv (PROT_NONE)
740 const_iv (PROT_EXEC) 760 const_iv (PROT_EXEC)
741 const_iv (PROT_NONE)
742 const_iv (PROT_READ) 761 const_iv (PROT_READ)
743 const_iv (PROT_WRITE) 762 const_iv (PROT_WRITE)
744 763
745 /*const_iv (MAP_FIXED)*/ 764 /*const_iv (MAP_FIXED)*/
746 const_iv (MAP_PRIVATE) 765 const_iv (MAP_PRIVATE)
752 const_iv (MAP_LOCKED) 771 const_iv (MAP_LOCKED)
753 const_iv (MAP_NORESERVE) 772 const_iv (MAP_NORESERVE)
754 const_iv (MAP_POPULATE) 773 const_iv (MAP_POPULATE)
755 const_iv (MAP_NONBLOCK) 774 const_iv (MAP_NONBLOCK)
756 775
757 const_iv (MCL_FUTURE) 776 const_eio (MCL_FUTURE)
758 const_iv (MCL_CURRENT) 777 const_eio (MCL_CURRENT)
759 778
760 const_eio (MS_ASYNC) 779 const_eio (MS_ASYNC)
761 const_eio (MS_INVALIDATE) 780 const_eio (MS_INVALIDATE)
762 const_eio (MS_SYNC) 781 const_eio (MS_SYNC)
763 782
837 CODE: 856 CODE:
838 max_outstanding = maxreqs; 857 max_outstanding = maxreqs;
839 858
840void 859void
841aio_open (SV8 *pathname, int flags, int mode, SV *callback=&PL_sv_undef) 860aio_open (SV8 *pathname, int flags, int mode, SV *callback=&PL_sv_undef)
842 PROTOTYPE: $$$;$
843 PPCODE: 861 PPCODE:
844{ 862{
845 dREQ; 863 dREQ;
846 864
847 req->type = EIO_OPEN; 865 req->type = EIO_OPEN;
853 REQ_SEND; 871 REQ_SEND;
854} 872}
855 873
856void 874void
857aio_fsync (SV *fh, SV *callback=&PL_sv_undef) 875aio_fsync (SV *fh, SV *callback=&PL_sv_undef)
858 PROTOTYPE: $;$
859 ALIAS: 876 ALIAS:
860 aio_fsync = EIO_FSYNC 877 aio_fsync = EIO_FSYNC
861 aio_fdatasync = EIO_FDATASYNC 878 aio_fdatasync = EIO_FDATASYNC
862 PPCODE: 879 PPCODE:
863{ 880{
871 REQ_SEND (req); 888 REQ_SEND (req);
872} 889}
873 890
874void 891void
875aio_sync_file_range (SV *fh, off_t offset, size_t nbytes, UV flags, SV *callback=&PL_sv_undef) 892aio_sync_file_range (SV *fh, off_t offset, size_t nbytes, UV flags, SV *callback=&PL_sv_undef)
876 PROTOTYPE: $$$$;$
877 PPCODE: 893 PPCODE:
878{ 894{
879 int fd = s_fileno_croak (fh, 0); 895 int fd = s_fileno_croak (fh, 0);
880 dREQ; 896 dREQ;
881 897
889 REQ_SEND (req); 905 REQ_SEND (req);
890} 906}
891 907
892void 908void
893aio_close (SV *fh, SV *callback=&PL_sv_undef) 909aio_close (SV *fh, SV *callback=&PL_sv_undef)
894 PROTOTYPE: $;$
895 PPCODE: 910 PPCODE:
896{ 911{
897 static int close_pipe = -1; /* dummy fd to close fds via dup2 */ 912 static int close_pipe = -1; /* dummy fd to close fds via dup2 */
898 int fd = s_fileno_croak (fh, 0); 913 int fd = s_fileno_croak (fh, 0);
899 dREQ; 914 dREQ;
921void 936void
922aio_read (SV *fh, SV *offset, SV *length, SV8 *data, IV dataoffset, SV *callback=&PL_sv_undef) 937aio_read (SV *fh, SV *offset, SV *length, SV8 *data, IV dataoffset, SV *callback=&PL_sv_undef)
923 ALIAS: 938 ALIAS:
924 aio_read = EIO_READ 939 aio_read = EIO_READ
925 aio_write = EIO_WRITE 940 aio_write = EIO_WRITE
926 PROTOTYPE: $$$$$;$
927 PPCODE: 941 PPCODE:
928{ 942{
929 STRLEN svlen; 943 STRLEN svlen;
930 int fd = s_fileno_croak (fh, ix == EIO_WRITE); 944 int fd = s_fileno_croak (fh, ix == EIO_WRITE);
931 char *svptr = SvPVbyte (data, svlen); 945 char *svptr = SvPVbyte (data, svlen);
972 } 986 }
973} 987}
974 988
975void 989void
976aio_readlink (SV8 *path, SV *callback=&PL_sv_undef) 990aio_readlink (SV8 *path, SV *callback=&PL_sv_undef)
977 PROTOTYPE: $$;$
978 PPCODE: 991 PPCODE:
979{ 992{
980 SV *data; 993 SV *data;
981 dREQ; 994 dREQ;
982 995
987 REQ_SEND; 1000 REQ_SEND;
988} 1001}
989 1002
990void 1003void
991aio_sendfile (SV *out_fh, SV *in_fh, off_t in_offset, size_t length, SV *callback=&PL_sv_undef) 1004aio_sendfile (SV *out_fh, SV *in_fh, off_t in_offset, size_t length, SV *callback=&PL_sv_undef)
992 PROTOTYPE: $$$$;$
993 PPCODE: 1005 PPCODE:
994{ 1006{
995 int ifd = s_fileno_croak (in_fh , 0); 1007 int ifd = s_fileno_croak (in_fh , 0);
996 int ofd = s_fileno_croak (out_fh, 1); 1008 int ofd = s_fileno_croak (out_fh, 1);
997 dREQ; 1009 dREQ;
1007 REQ_SEND; 1019 REQ_SEND;
1008} 1020}
1009 1021
1010void 1022void
1011aio_readahead (SV *fh, off_t offset, size_t length, SV *callback=&PL_sv_undef) 1023aio_readahead (SV *fh, off_t offset, size_t length, SV *callback=&PL_sv_undef)
1012 PROTOTYPE: $$$;$
1013 PPCODE: 1024 PPCODE:
1014{ 1025{
1015 int fd = s_fileno_croak (fh, 0); 1026 int fd = s_fileno_croak (fh, 0);
1016 dREQ; 1027 dREQ;
1017 1028
1218void 1229void
1219aio_mtouch (SV8 *data, IV offset = 0, SV *length = &PL_sv_undef, int flags = 0, SV *callback=&PL_sv_undef) 1230aio_mtouch (SV8 *data, IV offset = 0, SV *length = &PL_sv_undef, int flags = 0, SV *callback=&PL_sv_undef)
1220 ALIAS: 1231 ALIAS:
1221 aio_mtouch = EIO_MTOUCH 1232 aio_mtouch = EIO_MTOUCH
1222 aio_msync = EIO_MSYNC 1233 aio_msync = EIO_MSYNC
1223 PROTOTYPE: $$$$;$
1224 PPCODE: 1234 PPCODE:
1225{ 1235{
1226 STRLEN svlen; 1236 STRLEN svlen;
1237 char *svptr = SvPVbyte (data, svlen);
1227 UV len = SvUV (length); 1238 UV len = SvUV (length);
1228 char *svptr = SvPVbyte (data, svlen);
1229 1239
1230 if (offset < 0) 1240 if (offset < 0)
1231 offset += svlen; 1241 offset += svlen;
1232 1242
1233 if (offset < 0 || offset > svlen) 1243 if (offset < 0 || offset > svlen)
1238 1248
1239 { 1249 {
1240 dREQ; 1250 dREQ;
1241 1251
1242 req->type = ix; 1252 req->type = ix;
1243 req->size = len;
1244 req->sv2 = SvREFCNT_inc (data); 1253 req->sv2 = SvREFCNT_inc (data);
1245 req->ptr2 = (char *)svptr + offset; 1254 req->ptr2 = (char *)svptr + offset;
1255 req->size = len;
1246 req->int1 = flags; 1256 req->int1 = flags;
1247 1257
1248 REQ_SEND; 1258 REQ_SEND;
1249 } 1259 }
1250} 1260}
1251 1261
1252void 1262void
1263aio_mlock (SV8 *data, IV offset = 0, SV *length = &PL_sv_undef, SV *callback=&PL_sv_undef)
1264 PPCODE:
1265{
1266 STRLEN svlen;
1267 char *svptr = SvPVbyte (data, svlen);
1268 UV len = SvUV (length);
1269
1270 if (offset < 0)
1271 offset += svlen;
1272
1273 if (offset < 0 || offset > svlen)
1274 croak ("offset outside of scalar");
1275
1276 if (!SvOK (length) || len + offset > svlen)
1277 len = svlen - offset;
1278
1279 {
1280 dREQ;
1281
1282 req->type = EIO_MLOCK;
1283 req->sv2 = SvREFCNT_inc (data);
1284 req->ptr2 = (char *)svptr + offset;
1285 req->size = len;
1286
1287 REQ_SEND;
1288 }
1289}
1290
1291void
1292aio_mlockall (IV flags, SV *callback=&PL_sv_undef)
1293 PPCODE:
1294{
1295 dREQ;
1296
1297 req->type = EIO_MLOCKALL;
1298 req->int1 = flags;
1299
1300 REQ_SEND;
1301}
1302
1303void
1253aio_busy (double delay, SV *callback=&PL_sv_undef) 1304aio_busy (double delay, SV *callback=&PL_sv_undef)
1254 PPCODE: 1305 PPCODE:
1255{ 1306{
1256 dREQ; 1307 dREQ;
1257 1308
1261 REQ_SEND; 1312 REQ_SEND;
1262} 1313}
1263 1314
1264void 1315void
1265aio_group (SV *callback=&PL_sv_undef) 1316aio_group (SV *callback=&PL_sv_undef)
1266 PROTOTYPE: ;$
1267 PPCODE: 1317 PPCODE:
1268{ 1318{
1269 dREQ; 1319 dREQ;
1270 1320
1271 req->type = EIO_GROUP; 1321 req->type = EIO_GROUP;
1288 REQ_SEND; 1338 REQ_SEND;
1289} 1339}
1290 1340
1291int 1341int
1292aioreq_pri (int pri = 0) 1342aioreq_pri (int pri = 0)
1293 PROTOTYPE: ;$
1294 CODE: 1343 CODE:
1295 RETVAL = next_pri; 1344 RETVAL = next_pri;
1296 if (items > 0) 1345 if (items > 0)
1297 { 1346 {
1298 if (pri < EIO_PRI_MIN) pri = EIO_PRI_MIN; 1347 if (pri < EIO_PRI_MIN) pri = EIO_PRI_MIN;
1310 if (nice > EIO_PRI_MAX) nice = EIO_PRI_MAX; 1359 if (nice > EIO_PRI_MAX) nice = EIO_PRI_MAX;
1311 next_pri = nice; 1360 next_pri = nice;
1312 1361
1313void 1362void
1314flush () 1363flush ()
1315 PROTOTYPE:
1316 CODE: 1364 CODE:
1317 while (eio_nreqs ()) 1365 while (eio_nreqs ())
1318 { 1366 {
1319 poll_wait (); 1367 poll_wait ();
1320 poll_cb (); 1368 poll_cb ();
1321 } 1369 }
1322 1370
1323int 1371int
1324poll() 1372poll ()
1325 PROTOTYPE:
1326 CODE: 1373 CODE:
1327 poll_wait (); 1374 poll_wait ();
1328 RETVAL = poll_cb (); 1375 RETVAL = poll_cb ();
1329 OUTPUT: 1376 OUTPUT:
1330 RETVAL 1377 RETVAL
1331 1378
1332int 1379int
1333poll_fileno() 1380poll_fileno ()
1334 PROTOTYPE:
1335 CODE: 1381 CODE:
1336 RETVAL = s_epipe_fd (&respipe); 1382 RETVAL = s_epipe_fd (&respipe);
1337 OUTPUT: 1383 OUTPUT:
1338 RETVAL 1384 RETVAL
1339 1385
1340int 1386int
1341poll_cb(...) 1387poll_cb (...)
1342 PROTOTYPE: 1388 PROTOTYPE:
1343 CODE: 1389 CODE:
1344 RETVAL = poll_cb (); 1390 RETVAL = poll_cb ();
1345 OUTPUT: 1391 OUTPUT:
1346 RETVAL 1392 RETVAL
1347 1393
1348void 1394void
1349poll_wait() 1395poll_wait ()
1350 PROTOTYPE:
1351 CODE: 1396 CODE:
1352 poll_wait (); 1397 poll_wait ();
1353 1398
1354int 1399int
1355nreqs() 1400nreqs ()
1356 PROTOTYPE:
1357 CODE: 1401 CODE:
1358 RETVAL = eio_nreqs (); 1402 RETVAL = eio_nreqs ();
1359 OUTPUT: 1403 OUTPUT:
1360 RETVAL 1404 RETVAL
1361 1405
1362int 1406int
1363nready() 1407nready ()
1364 PROTOTYPE:
1365 CODE: 1408 CODE:
1366 RETVAL = eio_nready (); 1409 RETVAL = eio_nready ();
1367 OUTPUT: 1410 OUTPUT:
1368 RETVAL 1411 RETVAL
1369 1412
1370int 1413int
1371npending() 1414npending ()
1372 PROTOTYPE:
1373 CODE: 1415 CODE:
1374 RETVAL = eio_npending (); 1416 RETVAL = eio_npending ();
1375 OUTPUT: 1417 OUTPUT:
1376 RETVAL 1418 RETVAL
1377 1419
1378int 1420int
1379nthreads() 1421nthreads ()
1380 PROTOTYPE:
1381 CODE: 1422 CODE:
1382 RETVAL = eio_nthreads (); 1423 RETVAL = eio_nthreads ();
1383 OUTPUT: 1424 OUTPUT:
1384 RETVAL 1425 RETVAL
1385 1426
1386int 1427int
1387fadvise (aio_rfd fh, off_t offset, off_t length, IV advice) 1428fadvise (aio_rfd fh, off_t offset, off_t length, IV advice)
1388 PROTOTYPE: $$$$
1389 CODE: 1429 CODE:
1390#if _XOPEN_SOURCE >= 600 && !NO_FADVISE
1391 RETVAL = posix_fadvise (fh, offset, length, advice); 1430 RETVAL = posix_fadvise (fh, offset, length, advice);
1392#else
1393 RETVAL = errno = ENOSYS; /* yes, this is actually correct */
1394#endif
1395 OUTPUT: 1431 OUTPUT:
1396 RETVAL 1432 RETVAL
1397 1433
1398ssize_t 1434ssize_t
1399sendfile (aio_wfd ofh, aio_rfd ifh, off_t offset, size_t count) 1435sendfile (aio_wfd ofh, aio_rfd ifh, off_t offset, size_t count)
1400 PROTOTYPE: $$$$
1401 CODE: 1436 CODE:
1402 RETVAL = eio_sendfile_sync (ofh, ifh, offset, count); 1437 RETVAL = eio_sendfile_sync (ofh, ifh, offset, count);
1403 OUTPUT: 1438 OUTPUT:
1404 RETVAL 1439 RETVAL
1405 1440
1406void 1441void
1407mmap (SV *scalar, size_t length, int prot, int flags, SV *fh, off_t offset = 0) 1442mmap (SV *scalar, size_t length, int prot, int flags, SV *fh, off_t offset = 0)
1408 PROTOTYPE: $$$$$;$
1409 PPCODE: 1443 PPCODE:
1410 sv_unmagic (scalar, MMAP_MAGIC); 1444 sv_unmagic (scalar, MMAP_MAGIC);
1411{ 1445{
1412 int fd = SvOK (fh) ? s_fileno_croak (fh, flags & PROT_WRITE) : -1; 1446 int fd = SvOK (fh) ? s_fileno_croak (fh, flags & PROT_WRITE) : -1;
1413 void *addr = (void *)mmap (0, length, prot, flags, fd, offset); 1447 void *addr = (void *)mmap (0, length, prot, flags, fd, offset);
1436 XSRETURN_YES; 1470 XSRETURN_YES;
1437} 1471}
1438 1472
1439void 1473void
1440munmap (SV *scalar) 1474munmap (SV *scalar)
1441 PROTOTYPE: $
1442 CODE: 1475 CODE:
1443 sv_unmagic (scalar, MMAP_MAGIC); 1476 sv_unmagic (scalar, MMAP_MAGIC);
1444 1477
1445int 1478int
1446madvise (SV *scalar, off_t offset, off_t length, IV advice) 1479madvise (SV *scalar, off_t offset = 0, SV *length = &PL_sv_undef, IV advice_or_prot)
1447 PROTOTYPE: $$$$ 1480 ALIAS:
1481 mprotect = 1
1448 CODE: 1482 CODE:
1449{ 1483{
1450 char *addr = SvPV_nolen (scalar) + offset; 1484 STRLEN svlen;
1485 void *addr = SvPVbyte (scalar, svlen);
1486 size_t len = SvUV (length);
1451 1487
1452 if (!SvOK (ST (2))) 1488 if (offset < 0)
1489 offset += svlen;
1490
1491 if (offset < 0 || offset > svlen)
1492 croak ("offset outside of scalar");
1493
1494 if (!SvOK (length) || len + offset > svlen)
1453 length = SvCUR (scalar) - offset; 1495 len = svlen - offset;
1454 1496
1455 if (addr >= SvEND (scalar) || length <= 0) 1497 addr = (void *)(((intptr_t)addr) + offset);
1456 XSRETURN_EMPTY; 1498 eio_page_align (&addr, &len);
1457 1499
1458 #if _XOPEN_SOURCE >= 600 && !NO_MADVISE 1500 switch (ix)
1501 {
1459 RETVAL = posix_madvise (addr, length, advice); 1502 case 0: RETVAL = posix_madvise (addr, len, advice_or_prot); break;
1460 #else 1503 case 1: RETVAL = mprotect (addr, len, advice_or_prot); break;
1461 RETVAL = errno = ENOSYS; /* yes, this is actually correct */ 1504 }
1462 #endif
1463} 1505}
1464 OUTPUT: 1506 OUTPUT:
1465 RETVAL 1507 RETVAL
1466 1508
1467int 1509int
1468mlockall (int flags) 1510munlock (SV *scalar, off_t offset = 0, SV *length = &PL_sv_undef)
1469 PROTOTYPE: $
1470 CODE: 1511 CODE:
1512{
1513 STRLEN svlen;
1514 void *addr = SvPVbyte (scalar, svlen);
1515 size_t len = SvUV (length);
1516
1517 if (offset < 0)
1518 offset += svlen;
1519
1520 if (offset < 0 || offset > svlen)
1521 croak ("offset outside of scalar");
1522
1523 if (!SvOK (length) || len + offset > svlen)
1524 len = svlen - offset;
1525
1526 addr = (void *)(((intptr_t)addr) + offset);
1527 eio_page_align (&addr, &len);
1471#if _POSIX_MEMLOCK 1528#if _POSIX_MEMLOCK
1472#if __GLIBC__ == 2 && __GLIBC_MINOR__ <= 7 1529 RETVAL = munlock (addr, len);
1473 extern int mallopt (int, int);
1474 mallopt (-6, 238); /* http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=473812 */
1475#endif
1476 mlockall (flags);
1477#else 1530#else
1478 RETVAL = -1; 1531 RETVAL = ((errno = ENOSYS), -1);
1479 errno = ENOSYS;
1480#endif 1532#endif
1533}
1481 OUTPUT: 1534 OUTPUT:
1482 RETVAL 1535 RETVAL
1483 1536
1484int 1537int
1485munlockall () 1538munlockall ()
1486 PROTOTYPE:
1487 CODE: 1539 CODE:
1488#if _POSIX_MEMLOCK 1540#if _POSIX_MEMLOCK
1489 munlockall (); 1541 munlockall ();
1490#else 1542#else
1491 RETVAL = -1; 1543 RETVAL = -1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines