Changeset dbae916 for libcfa/src


Ignore:
Timestamp:
Mar 14, 2023, 4:21:05 PM (16 months ago)
Author:
caparsons <caparson@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
libcfa/src
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/algorithms/range_iterator.hfa

    r5217569 rdbae916  
    99// Author           : Thierry Delisle
    1010// 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
    1414//
     15
     16#pragma once
    1517
    1618generator RangeIter {
  • libcfa/src/concurrency/channel.hfa

    r5217569 rdbae916  
     1#pragma once
     2
    13#include <locks.hfa>
    24
  • libcfa/src/concurrency/clib/cfathread.cfa

    r5217569 rdbae916  
    1717
    1818#include <string.h>
    19 #include <errno.h>
    20 #include <unistd.h>
    21 #include <sys/socket.h>
    2219
    2320#include "fstream.hfa"
  • libcfa/src/concurrency/clib/cfathread.h

    r5217569 rdbae916  
    1010// Created On       : Tue Sep 22 15:31:20 2020
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Feb 25 17:39:20 2023
    13 // Update Count     : 6
     12// Last Modified On : Mon Mar 13 23:48:40 2023
     13// Update Count     : 7
    1414//
     15
     16#pragma once
    1517
    1618#if defined(__cforall) || defined(__cplusplus)
  • libcfa/src/concurrency/future.hfa

    r5217569 rdbae916  
    1414//
    1515
    16 // #pragma once
     16#pragma once
    1717
    1818#include "bits/locks.hfa"
  • libcfa/src/concurrency/invoke.h

    r5217569 rdbae916  
    1010// Created On       : Tue Jan 17 12:27:26 2016
    1111// 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.
    1517
    1618#include "bits/containers.hfa"
  • libcfa/src/concurrency/iofwd.hfa

    r5217569 rdbae916  
    99// Author           : Thierry Delisle
    1010// 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
    1414//
    1515
     
    5050typedef __off64_t off64_t;
    5151
    52 struct cluster;
    53 struct io_context$;
    54 
    55 struct iovec;
    56 struct msghdr;
    57 struct statx;
    5852struct epoll_event;
    59 
    60 struct io_uring_sqe;
    6153
    6254//-----------------------------------------------------------------------
     
    8981// synchronous calls
    9082#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);
    9284#endif
    9385#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);
    9587#endif
    9688extern 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);
     89extern int cfa_epoll_ctl(int epfd, int op, int fd, struct epoll_event * event, __u64 submit_flags);
    9890extern 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);
     91extern  ssize_t cfa_sendmsg(int sockfd, const struct msghdr * msg, int flags, __u64 submit_flags);
     92extern ssize_t cfa_recvmsg(int sockfd, struct msghdr * msg, int flags, __u64 submit_flags);
     93extern ssize_t cfa_send(int sockfd, const void * buf, size_t len, int flags, __u64 submit_flags);
     94extern ssize_t cfa_recv(int sockfd, void * buf, size_t len, int flags, __u64 submit_flags);
    10395extern int cfa_accept4(int sockfd, __SOCKADDR_ARG addr, socklen_t * restrict addrlen, int flags, __u64 submit_flags);
    10496extern int cfa_connect(int sockfd, __CONST_SOCKADDR_ARG addr, socklen_t addrlen, __u64 submit_flags);
    10597extern int cfa_fallocate(int fd, int mode, off_t offset, off_t len, __u64 submit_flags);
    10698extern 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);
     99extern int cfa_madvise(void * addr, size_t length, int advice, __u64 submit_flags);
     100extern int cfa_openat(int dirfd, const char * pathname, int flags, mode_t mode, __u64 submit_flags);
    109101#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);
    111103#endif
    112104extern int cfa_close(int fd, __u64 submit_flags);
    113105#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);
    115107#endif
    116108extern ssize_t cfa_read(int fd, void * buf, size_t count, __u64 submit_flags);
    117109extern 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);
     110extern 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);
    119111extern ssize_t cfa_tee(int fd_in, int fd_out, size_t len, unsigned int flags, __u64 submit_flags);
    120112
     
    122114// asynchronous calls
    123115#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);
    125117#endif
    126118#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);
    128120#endif
    129121extern 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);
     122extern void async_epoll_ctl(io_future_t & future, int epfd, int op, int fd, struct epoll_event * event, __u64 submit_flags);
    131123extern 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);
     124extern void async_sendmsg(io_future_t & future, int sockfd, const struct msghdr * msg, int flags, __u64 submit_flags);
     125extern void async_recvmsg(io_future_t & future, int sockfd, struct msghdr * msg, int flags, __u64 submit_flags);
     126extern void async_send(io_future_t & future, int sockfd, const void * buf, size_t len, int flags, __u64 submit_flags);
     127extern void async_recv(io_future_t & future, int sockfd, void * buf, size_t len, int flags, __u64 submit_flags);
    136128extern void async_accept4(io_future_t & future, int sockfd, __SOCKADDR_ARG addr, socklen_t * restrict addrlen, int flags, __u64 submit_flags);
    137129extern void async_connect(io_future_t & future, int sockfd, __CONST_SOCKADDR_ARG addr, socklen_t addrlen, __u64 submit_flags);
    138130extern void async_fallocate(io_future_t & future, int fd, int mode, off_t offset, off_t len, __u64 submit_flags);
    139131extern 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);
     132extern void async_madvise(io_future_t & future, void * addr, size_t length, int advice, __u64 submit_flags);
     133extern void async_openat(io_future_t & future, int dirfd, const char * pathname, int flags, mode_t mode, __u64 submit_flags);
    142134#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);
    144136#endif
    145137extern void async_close(io_future_t & future, int fd, __u64 submit_flags);
    146138#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);
    148140#endif
    149141void async_read(io_future_t & future, int fd, void * buf, size_t count, __u64 submit_flags);
    150142extern 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);
     143extern 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);
    152144extern void async_tee(io_future_t & future, int fd_in, int fd_out, size_t len, unsigned int flags, __u64 submit_flags);
    153145
  • libcfa/src/concurrency/kernel/startup.cfa

    r5217569 rdbae916  
    3333#include "kernel/private.hfa"
    3434#include "iofwd.hfa"
    35 #include "startup.hfa"                                  // STARTUP_PRIORITY_XXX
     35#include "startup.hfa"                                                                  // STARTUP_PRIORITY_XXX
    3636#include "limits.hfa"
    3737#include "math.hfa"
  • libcfa/src/concurrency/mutex_stmt.hfa

    r5217569 rdbae916  
     1#pragma once
     2
    13#include "bits/algorithm.hfa"
    24#include "bits/defs.hfa"
  • libcfa/src/concurrency/pthread.cfa

    r5217569 rdbae916  
    598598                if (t->pthreadData == NULL) return NULL;
    599599                lock(key_lock);
    600                 pthread_values &entry = ((pthread_values *)t->pthreadData)[key];
     600                pthread_values & entry = ((pthread_values *)t->pthreadData)[key];
    601601                if ( ! entry.in_use ) {
    602602                        unlock( key_lock );
  • libcfa/src/concurrency/select.hfa

    r5217569 rdbae916  
     1#pragma once
     2
    13#include "containers/list.hfa"
    24#include <stdint.h>
  • libcfa/src/containers/vector2.hfa

    r5217569 rdbae916  
    99// Author           : Michael Brooks
    1010// 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
    1517
    1618#include <stdlib.hfa>
  • libcfa/src/interpose.cfa

    r5217569 rdbae916  
    1010// Created On       : Wed Mar 29 16:10:31 2017
    1111// 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
    1716#include <stdio.h>
    18 #include <string.h>                                                                             // strlen
    1917#include <unistd.h>                                                                             // _exit, getpid
    20 #include <signal.h>
    2118extern "C" {
    2219#include <dlfcn.h>                                                                              // dlopen, dlsym
     
    2421}
    2522
    26 #include "bits/debug.hfa"
    2723#include "bits/defs.hfa"
    2824#include "bits/signal.hfa"                                                              // sigHandler_?
     
    4036
    4137typedef void (* generic_fptr_t)(void);
     38
    4239static generic_fptr_t do_interpose_symbol( void * library, const char symbol[], const char version[] ) {
    43         const char * error;
    44 
    4540        union { generic_fptr_t fptr; void * ptr; } originalFunc;
    4641
    4742        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
    5146        return originalFunc.fptr;
    5247}
     
    5752        library = RTLD_NEXT;
    5853        #else
     54        // missing RTLD_NEXT => must hard-code library name, assuming libstdc++
    5955        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() );
    6558        } // 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 );
    6962}
    7063
  • libcfa/src/interpose_thread.cfa

    r5217569 rdbae916  
    1414//
    1515
    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
    1920#include <signal.h>
    2021#include <pthread.h>
     22#include <signal.h>
    2123extern "C" {
    2224#include <dlfcn.h>                                                                              // dlopen, dlsym
    23 #include <execinfo.h>                                                                   // backtrace, messages
    2425}
    2526
    26 #include "bits/debug.hfa"
    2727#include "bits/defs.hfa"
    28 #include <assert.h>
    2928
    3029//=============================================================================================
     
    4039) libcfa_public {
    4140        void * library;
     41
    4242        #if defined( RTLD_NEXT )
    4343        library = RTLD_NEXT;
    4444        #else
    4545        // 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() );
    5249        } // if
    5350        #endif // RTLD_NEXT
    5451
    55         return do_interpose_symbol(library, symbol, version);
     52        return do_interpose_symbol( library, symbol, version );
    5653}
    5754
     
    8178#pragma GCC diagnostic push
    8279#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
    83                 INTERPOSE( pthread_create , version );
    84                 INTERPOSE( pthread_join , version );
    85                 INTERPOSE( pthread_self , version );
    86                 INTERPOSE( pthread_attr_init , version );
    87                 INTERPOSE( pthread_attr_destroy , version );
    88                 INTERPOSE( pthread_attr_setstack , version );
    89                 INTERPOSE( pthread_attr_getstacksize , version );
    90                 INTERPOSE( pthread_sigmask , version );
    91                 INTERPOSE( pthread_sigqueue , version );
    92                 INTERPOSE( pthread_once , version );
     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 );
    9390#pragma GCC diagnostic pop
    9491        }
Note: See TracChangeset for help on using the changeset viewer.