File indexing completed on 2025-02-22 10:47:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef PMIX_UTIL_SHMEM_H
0012 #define PMIX_UTIL_SHMEM_H
0013
0014 #include "src/include/pmix_config.h"
0015 #include "include/pmix_common.h"
0016 #include "src/class/pmix_object.h"
0017
0018 #include <sys/stat.h>
0019
0020
0021
0022
0023 typedef uint8_t pmix_shmem_flags_t;
0024
0025 typedef enum {
0026
0027
0028
0029
0030 PMIX_SHMEM_MUST_MAP_AT_RADDR = 0x01
0031 } pmix_shmem_flag_t;
0032
0033 typedef struct pmix_shmem_t {
0034
0035 pmix_object_t super;
0036
0037 volatile bool attached;
0038
0039 size_t size;
0040
0041 void *hdr_address;
0042
0043 void *data_address;
0044
0045 char backing_path[PMIX_PATH_MAX];
0046 } pmix_shmem_t;
0047 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_shmem_t);
0048
0049 PMIX_EXPORT pmix_status_t
0050 pmix_shmem_segment_create(
0051 pmix_shmem_t *shmem,
0052 size_t size,
0053 const char *backing_path
0054 );
0055
0056 PMIX_EXPORT pmix_status_t
0057 pmix_shmem_segment_attach(
0058 pmix_shmem_t *shmem,
0059 uintptr_t desired_base_address,
0060 pmix_shmem_flags_t flags
0061 );
0062
0063 PMIX_EXPORT pmix_status_t
0064 pmix_shmem_segment_detach(
0065 pmix_shmem_t *shmem
0066 );
0067
0068 PMIX_EXPORT pmix_status_t
0069 pmix_shmem_segment_unlink(
0070 pmix_shmem_t *shmem
0071 );
0072
0073
0074
0075
0076 PMIX_EXPORT pmix_status_t
0077 pmix_shmem_segment_chown(
0078 pmix_shmem_t *shmem,
0079 uid_t owner,
0080 gid_t group
0081 );
0082
0083
0084
0085
0086 PMIX_EXPORT pmix_status_t
0087 pmix_shmem_segment_chmod(
0088 pmix_shmem_t *shmem,
0089 mode_t mode
0090 );
0091
0092
0093
0094
0095 PMIX_EXPORT size_t
0096 pmix_shmem_utils_pad_to_page(
0097 size_t size
0098 );
0099
0100 #endif