How do I obtain `sizeof(struct sigaction)`? Clang.jl?

mkitti
Sun, 17 Jul 2022 02:32:23 +0000
General Usage

I would like to figure out the value printed by this C program in Julia.

 #include <signal.h>
 #include <stdio.h>

 int main() {
     printf("%ld", sizeof(struct sigaction));
     return 0;
 }

On my system, this prints 152 bytes.

My /usr/include/x86_64-linux-gnu/bits/sigaction.h has this definition:
https://sourceware.org/git/?p=glibc.git;a=blob;f=bits/sigaction.h;h=cef879f40aae8e14b2e998daeded26ebe5cfad9d;hb=HEAD#l32

Other than building the C code above, is there a way to obtain the size of this struct within Julia?

5 posts - 2 participants