- Timestamp:
- Mar 14, 2023, 4:21:05 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 1afd9ccb, 360bfe41, 6e6989c
- Parents:
- 5217569 (diff), c19ca4b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- libcfa/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified libcfa/src/algorithms/range_iterator.hfa ¶
r5217569 rdbae916 9 9 // Author : Thierry Delisle 10 10 // Created On : Tue Nov 30 13:06:22 2021 11 // Last Modified By : 12 // Last Modified On : 13 // Update Count : 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 13 23:10:35 2023 13 // Update Count : 1 14 14 // 15 16 #pragma once 15 17 16 18 generator RangeIter { -
TabularUnified libcfa/src/concurrency/channel.hfa ¶
r5217569 rdbae916 1 #pragma once 2 1 3 #include <locks.hfa> 2 4 -
TabularUnified libcfa/src/concurrency/clib/cfathread.cfa ¶
r5217569 rdbae916 17 17 18 18 #include <string.h> 19 #include <errno.h>20 #include <unistd.h>21 #include <sys/socket.h>22 19 23 20 #include "fstream.hfa" -
TabularUnified libcfa/src/concurrency/clib/cfathread.h ¶
r5217569 rdbae916 10 10 // Created On : Tue Sep 22 15:31:20 2020 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 25 17:39:20 202313 // Update Count : 612 // Last Modified On : Mon Mar 13 23:48:40 2023 13 // Update Count : 7 14 14 // 15 16 #pragma once 15 17 16 18 #if defined(__cforall) || defined(__cplusplus) -
TabularUnified libcfa/src/concurrency/future.hfa ¶
r5217569 rdbae916 14 14 // 15 15 16 //#pragma once16 #pragma once 17 17 18 18 #include "bits/locks.hfa" -
TabularUnified libcfa/src/concurrency/invoke.h ¶
r5217569 rdbae916 10 10 // Created On : Tue Jan 17 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 29 20:42:21 2022 13 // Update Count : 56 14 // 12 // Last Modified On : Tue Mar 14 13:39:31 2023 13 // Update Count : 59 14 // 15 16 // No not use #pragma once was this file is included twice in some places. It has its own guard system. 15 17 16 18 #include "bits/containers.hfa" -
TabularUnified libcfa/src/concurrency/iofwd.hfa ¶
r5217569 rdbae916 9 9 // Author : Thierry Delisle 10 10 // Created On : Thu Apr 23 17:31:00 2020 11 // Last Modified By : 12 // Last Modified On : 13 // Update Count : 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 13 23:54:57 2023 13 // Update Count : 1 14 14 // 15 15 … … 50 50 typedef __off64_t off64_t; 51 51 52 struct cluster;53 struct io_context$;54 55 struct iovec;56 struct msghdr;57 struct statx;58 52 struct epoll_event; 59 60 struct io_uring_sqe;61 53 62 54 //----------------------------------------------------------------------- … … 89 81 // synchronous calls 90 82 #if defined(CFA_HAVE_PREADV2) 91 extern ssize_t cfa_preadv2(int fd, const struct iovec * iov, int iovcnt, off_t offset, int flags, __u64 submit_flags);83 extern ssize_t cfa_preadv2(int fd, const struct iovec * iov, int iovcnt, off_t offset, int flags, __u64 submit_flags); 92 84 #endif 93 85 #if defined(CFA_HAVE_PWRITEV2) 94 extern ssize_t cfa_pwritev2(int fd, const struct iovec * iov, int iovcnt, off_t offset, int flags, __u64 submit_flags);86 extern ssize_t cfa_pwritev2(int fd, const struct iovec * iov, int iovcnt, off_t offset, int flags, __u64 submit_flags); 95 87 #endif 96 88 extern int cfa_fsync(int fd, __u64 submit_flags); 97 extern int cfa_epoll_ctl(int epfd, int op, int fd, struct epoll_event * event, __u64 submit_flags);89 extern int cfa_epoll_ctl(int epfd, int op, int fd, struct epoll_event * event, __u64 submit_flags); 98 90 extern int cfa_sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags, __u64 submit_flags); 99 extern ssize_t cfa_sendmsg(int sockfd, const struct msghdr * msg, int flags, __u64 submit_flags);100 extern ssize_t cfa_recvmsg(int sockfd, struct msghdr * msg, int flags, __u64 submit_flags);101 extern ssize_t cfa_send(int sockfd, const void * buf, size_t len, int flags, __u64 submit_flags);102 extern ssize_t cfa_recv(int sockfd, void * buf, size_t len, int flags, __u64 submit_flags);91 extern ssize_t cfa_sendmsg(int sockfd, const struct msghdr * msg, int flags, __u64 submit_flags); 92 extern ssize_t cfa_recvmsg(int sockfd, struct msghdr * msg, int flags, __u64 submit_flags); 93 extern ssize_t cfa_send(int sockfd, const void * buf, size_t len, int flags, __u64 submit_flags); 94 extern ssize_t cfa_recv(int sockfd, void * buf, size_t len, int flags, __u64 submit_flags); 103 95 extern int cfa_accept4(int sockfd, __SOCKADDR_ARG addr, socklen_t * restrict addrlen, int flags, __u64 submit_flags); 104 96 extern int cfa_connect(int sockfd, __CONST_SOCKADDR_ARG addr, socklen_t addrlen, __u64 submit_flags); 105 97 extern int cfa_fallocate(int fd, int mode, off_t offset, off_t len, __u64 submit_flags); 106 98 extern int cfa_posix_fadvise(int fd, off_t offset, off_t len, int advice, __u64 submit_flags); 107 extern int cfa_madvise(void * addr, size_t length, int advice, __u64 submit_flags);108 extern int cfa_openat(int dirfd, const char * pathname, int flags, mode_t mode, __u64 submit_flags);99 extern int cfa_madvise(void * addr, size_t length, int advice, __u64 submit_flags); 100 extern int cfa_openat(int dirfd, const char * pathname, int flags, mode_t mode, __u64 submit_flags); 109 101 #if defined(CFA_HAVE_OPENAT2) 110 extern int cfa_openat2(int dirfd, const char * pathname, struct open_how * how, size_t size, __u64 submit_flags);102 extern int cfa_openat2(int dirfd, const char * pathname, struct open_how * how, size_t size, __u64 submit_flags); 111 103 #endif 112 104 extern int cfa_close(int fd, __u64 submit_flags); 113 105 #if defined(CFA_HAVE_STATX) 114 extern int cfa_statx(int dirfd, const char * pathname, int flags, unsigned int mask, struct statx *statxbuf, __u64 submit_flags);106 extern int cfa_statx(int dirfd, const char * pathname, int flags, unsigned int mask, struct statx * statxbuf, __u64 submit_flags); 115 107 #endif 116 108 extern ssize_t cfa_read(int fd, void * buf, size_t count, __u64 submit_flags); 117 109 extern ssize_t cfa_write(int fd, void * buf, size_t count, __u64 submit_flags); 118 extern ssize_t cfa_splice(int fd_in, __off64_t * off_in, int fd_out, __off64_t *off_out, size_t len, unsigned int flags, __u64 submit_flags);110 extern ssize_t cfa_splice(int fd_in, __off64_t * off_in, int fd_out, __off64_t * off_out, size_t len, unsigned int flags, __u64 submit_flags); 119 111 extern ssize_t cfa_tee(int fd_in, int fd_out, size_t len, unsigned int flags, __u64 submit_flags); 120 112 … … 122 114 // asynchronous calls 123 115 #if defined(CFA_HAVE_PREADV2) 124 extern void async_preadv2(io_future_t & future, int fd, const struct iovec * iov, int iovcnt, off_t offset, int flags, __u64 submit_flags);116 extern void async_preadv2(io_future_t & future, int fd, const struct iovec * iov, int iovcnt, off_t offset, int flags, __u64 submit_flags); 125 117 #endif 126 118 #if defined(CFA_HAVE_PWRITEV2) 127 extern void async_pwritev2(io_future_t & future, int fd, const struct iovec * iov, int iovcnt, off_t offset, int flags, __u64 submit_flags);119 extern void async_pwritev2(io_future_t & future, int fd, const struct iovec * iov, int iovcnt, off_t offset, int flags, __u64 submit_flags); 128 120 #endif 129 121 extern void async_fsync(io_future_t & future, int fd, __u64 submit_flags); 130 extern void async_epoll_ctl(io_future_t & future, int epfd, int op, int fd, struct epoll_event * event, __u64 submit_flags);122 extern void async_epoll_ctl(io_future_t & future, int epfd, int op, int fd, struct epoll_event * event, __u64 submit_flags); 131 123 extern void async_sync_file_range(io_future_t & future, int fd, off64_t offset, off64_t nbytes, unsigned int flags, __u64 submit_flags); 132 extern void async_sendmsg(io_future_t & future, int sockfd, const struct msghdr * msg, int flags, __u64 submit_flags);133 extern void async_recvmsg(io_future_t & future, int sockfd, struct msghdr * msg, int flags, __u64 submit_flags);134 extern void async_send(io_future_t & future, int sockfd, const void * buf, size_t len, int flags, __u64 submit_flags);135 extern void async_recv(io_future_t & future, int sockfd, void * buf, size_t len, int flags, __u64 submit_flags);124 extern void async_sendmsg(io_future_t & future, int sockfd, const struct msghdr * msg, int flags, __u64 submit_flags); 125 extern void async_recvmsg(io_future_t & future, int sockfd, struct msghdr * msg, int flags, __u64 submit_flags); 126 extern void async_send(io_future_t & future, int sockfd, const void * buf, size_t len, int flags, __u64 submit_flags); 127 extern void async_recv(io_future_t & future, int sockfd, void * buf, size_t len, int flags, __u64 submit_flags); 136 128 extern void async_accept4(io_future_t & future, int sockfd, __SOCKADDR_ARG addr, socklen_t * restrict addrlen, int flags, __u64 submit_flags); 137 129 extern void async_connect(io_future_t & future, int sockfd, __CONST_SOCKADDR_ARG addr, socklen_t addrlen, __u64 submit_flags); 138 130 extern void async_fallocate(io_future_t & future, int fd, int mode, off_t offset, off_t len, __u64 submit_flags); 139 131 extern void async_posix_fadvise(io_future_t & future, int fd, off_t offset, off_t len, int advice, __u64 submit_flags); 140 extern void async_madvise(io_future_t & future, void * addr, size_t length, int advice, __u64 submit_flags);141 extern void async_openat(io_future_t & future, int dirfd, const char * pathname, int flags, mode_t mode, __u64 submit_flags);132 extern void async_madvise(io_future_t & future, void * addr, size_t length, int advice, __u64 submit_flags); 133 extern void async_openat(io_future_t & future, int dirfd, const char * pathname, int flags, mode_t mode, __u64 submit_flags); 142 134 #if defined(CFA_HAVE_OPENAT2) 143 extern void async_openat2(io_future_t & future, int dirfd, const char * pathname, struct open_how * how, size_t size, __u64 submit_flags);135 extern void async_openat2(io_future_t & future, int dirfd, const char * pathname, struct open_how * how, size_t size, __u64 submit_flags); 144 136 #endif 145 137 extern void async_close(io_future_t & future, int fd, __u64 submit_flags); 146 138 #if defined(CFA_HAVE_STATX) 147 extern void async_statx(io_future_t & future, int dirfd, const char * pathname, int flags, unsigned int mask, struct statx *statxbuf, __u64 submit_flags);139 extern void async_statx(io_future_t & future, int dirfd, const char * pathname, int flags, unsigned int mask, struct statx * statxbuf, __u64 submit_flags); 148 140 #endif 149 141 void async_read(io_future_t & future, int fd, void * buf, size_t count, __u64 submit_flags); 150 142 extern void async_write(io_future_t & future, int fd, void * buf, size_t count, __u64 submit_flags); 151 extern void async_splice(io_future_t & future, int fd_in, __off64_t * off_in, int fd_out, __off64_t *off_out, size_t len, unsigned int flags, __u64 submit_flags);143 extern void async_splice(io_future_t & future, int fd_in, __off64_t * off_in, int fd_out, __off64_t * off_out, size_t len, unsigned int flags, __u64 submit_flags); 152 144 extern void async_tee(io_future_t & future, int fd_in, int fd_out, size_t len, unsigned int flags, __u64 submit_flags); 153 145 -
TabularUnified libcfa/src/concurrency/kernel/startup.cfa ¶
r5217569 rdbae916 33 33 #include "kernel/private.hfa" 34 34 #include "iofwd.hfa" 35 #include "startup.hfa" // STARTUP_PRIORITY_XXX35 #include "startup.hfa" // STARTUP_PRIORITY_XXX 36 36 #include "limits.hfa" 37 37 #include "math.hfa" -
TabularUnified libcfa/src/concurrency/mutex_stmt.hfa ¶
r5217569 rdbae916 1 #pragma once 2 1 3 #include "bits/algorithm.hfa" 2 4 #include "bits/defs.hfa" -
TabularUnified libcfa/src/concurrency/pthread.cfa ¶
r5217569 rdbae916 598 598 if (t->pthreadData == NULL) return NULL; 599 599 lock(key_lock); 600 pthread_values & entry = ((pthread_values *)t->pthreadData)[key];600 pthread_values & entry = ((pthread_values *)t->pthreadData)[key]; 601 601 if ( ! entry.in_use ) { 602 602 unlock( key_lock ); -
TabularUnified libcfa/src/concurrency/select.hfa ¶
r5217569 rdbae916 1 #pragma once 2 1 3 #include "containers/list.hfa" 2 4 #include <stdint.h> -
TabularUnified libcfa/src/containers/vector2.hfa ¶
r5217569 rdbae916 9 9 // Author : Michael Brooks 10 10 // Created On : Thu Jun 23 22:00:00 2021 11 // Last Modified By : Michael Brooks 12 // Last Modified On : Thu Jun 23 22:00:00 2021 13 // Update Count : 1 14 // 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 14 08:40:53 2023 13 // Update Count : 2 14 // 15 16 #pragma once 15 17 16 18 #include <stdlib.hfa> -
TabularUnified libcfa/src/interpose.cfa ¶
r5217569 rdbae916 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 2 13:56:26 2023 13 // Update Count : 191 14 // 15 16 #include <stdarg.h> // va_start, va_end 12 // Last Modified On : Mon Mar 13 22:39:12 2023 13 // Update Count : 193 14 // 15 17 16 #include <stdio.h> 18 #include <string.h> // strlen19 17 #include <unistd.h> // _exit, getpid 20 #include <signal.h>21 18 extern "C" { 22 19 #include <dlfcn.h> // dlopen, dlsym … … 24 21 } 25 22 26 #include "bits/debug.hfa"27 23 #include "bits/defs.hfa" 28 24 #include "bits/signal.hfa" // sigHandler_? … … 40 36 41 37 typedef void (* generic_fptr_t)(void); 38 42 39 static generic_fptr_t do_interpose_symbol( void * library, const char symbol[], const char version[] ) { 43 const char * error;44 45 40 union { generic_fptr_t fptr; void * ptr; } originalFunc; 46 41 47 42 originalFunc.ptr = dlsym( library, symbol ); 48 error = dlerror();49 if ( error ) abort( "interpose_symbol : internal error, %s\n", error);50 43 if ( ! originalFunc.ptr ) { // == nullptr 44 abort( "interpose_symbol : internal error, %s\n", dlerror() ); 45 } // if 51 46 return originalFunc.fptr; 52 47 } … … 57 52 library = RTLD_NEXT; 58 53 #else 54 // missing RTLD_NEXT => must hard-code library name, assuming libstdc++ 59 55 library = dlopen( "libc.so.6", RTLD_LAZY ); 60 if ( ! library ) { 61 const char * error = dlerror(); 62 if ( error ) { 63 abort( "interpose_symbol : failed to open libc, %s\n", error ); 64 } // if 56 if ( ! library ) { // == nullptr 57 abort( "interpose_symbol : failed to open libc, %s\n", dlerror() ); 65 58 } // if 66 #endif 67 68 return do_interpose_symbol( library, symbol, version);59 #endif // RTLD_NEXT 60 61 return do_interpose_symbol( library, symbol, version ); 69 62 } 70 63 -
TabularUnified libcfa/src/interpose_thread.cfa ¶
r5217569 rdbae916 14 14 // 15 15 16 #include <stdarg.h> // va_start, va_end 17 #include <stdio.h> 18 #include <string.h> // strlen 16 #ifdef __i386__ // 32-bit architecture 17 #undef _GNU_SOURCE 18 #endif // __i386__ 19 19 20 #include <signal.h> 20 21 #include <pthread.h> 22 #include <signal.h> 21 23 extern "C" { 22 24 #include <dlfcn.h> // dlopen, dlsym 23 #include <execinfo.h> // backtrace, messages24 25 } 25 26 26 #include "bits/debug.hfa"27 27 #include "bits/defs.hfa" 28 #include <assert.h>29 28 30 29 //============================================================================================= … … 40 39 ) libcfa_public { 41 40 void * library; 41 42 42 #if defined( RTLD_NEXT ) 43 43 library = RTLD_NEXT; 44 44 #else 45 45 // missing RTLD_NEXT => must hard-code library name, assuming libstdc++ 46 library = dlopen( "libthread_db.so", RTLD_LAZY ); 47 if ( ! library ) { 48 const char * error = dlerror(); 49 if ( error ) { 50 abort( "interpose_symbol : failed to open libpthread, %s\n", error ); 51 } 46 library = dlopen( "libpthread.so", RTLD_LAZY ); 47 if ( ! library ) { // == nullptr 48 abort( "interpose_symbol : failed to open libpthread, %s\n", dlerror() ); 52 49 } // if 53 50 #endif // RTLD_NEXT 54 51 55 return do_interpose_symbol( library, symbol, version);52 return do_interpose_symbol( library, symbol, version ); 56 53 } 57 54 … … 81 78 #pragma GCC diagnostic push 82 79 #pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" 83 INTERPOSE( pthread_create 84 INTERPOSE( pthread_join 85 INTERPOSE( pthread_self 86 INTERPOSE( pthread_attr_init 87 INTERPOSE( pthread_attr_destroy 88 INTERPOSE( pthread_attr_setstack 89 INTERPOSE( pthread_attr_getstacksize 90 INTERPOSE( pthread_sigmask 91 INTERPOSE( pthread_sigqueue 92 INTERPOSE( pthread_once 80 INTERPOSE( pthread_create, version ); 81 INTERPOSE( pthread_join, version ); 82 INTERPOSE( pthread_self, version ); 83 INTERPOSE( pthread_attr_init, version ); 84 INTERPOSE( pthread_attr_destroy, version ); 85 INTERPOSE( pthread_attr_setstack, version ); 86 INTERPOSE( pthread_attr_getstacksize, version ); 87 INTERPOSE( pthread_sigmask, version ); 88 INTERPOSE( pthread_sigqueue, version ); 89 INTERPOSE( pthread_once, version ); 93 90 #pragma GCC diagnostic pop 94 91 }
Note: See TracChangeset
for help on using the changeset viewer.