Changeset e8e9052
- Timestamp:
- 05/18/18 14:54:59 (3 years ago)
- Branches:
- cachetimestamps, develop, master, rc-4.0.4, ringdecrementfix, ringperformance
- Children:
- 5577521
- Parents:
- a7e4f40
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
configure.in
rb663d33 re8e9052 554 554 555 555 556 have_memfd_create=no 557 AC_RUN_IFELSE([AC_LANG_PROGRAM([ 558 #include <sys/syscall.h> 559 ],[ 560 #ifndef __NR_memfd_create 561 exit(1) 562 #endif 563 ])], [have_memfd_create=yes]) 564 565 if test "$have_memfd_create" = "yes"; then 566 AC_DEFINE(HAVE_MEMFD_CREATE, 1, [Set to 1 if kernel supports memfd_create syscall]) 567 fi 568 556 569 # Stupid AC_SEARCH_LIB appends stuff to LIBS even when I don't want it to, so 557 570 # just set libs to null here to avoid linking against them by default -
lib/data-struct/simple_circular_buffer.c
r25c305d re8e9052 7 7 #include <stdio.h> 8 8 #include <sys/syscall.h> 9 #include <sys/stat.h> 10 #include <fcntl.h> 9 11 #include <sys/socket.h> 10 12 … … 21 23 22 24 snprintf(anonname, 32, "lt_scb_%u", id); 25 #ifdef HAVE_MEMFD_CREATE 23 26 buf->fd = syscall(__NR_memfd_create, anonname, 0); 27 #else 28 buf->fd = shm_open(anonname, O_RDWR | O_CREAT, 0600); 29 #endif 24 30 ftruncate(buf->fd, size); 25 31 … … 36 42 37 43 DLLEXPORT void libtrace_scb_destroy(libtrace_scb_t *buf) { 44 /* TODO shm_unlink the file name if we used shm_open? */ 45 38 46 munmap(buf->address, buf->count_bytes * 2); 47 close(buf->fd); 39 48 } 40 49
Note: See TracChangeset
for help on using the changeset viewer.