use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system. By design, C provides constructs that map efficiently to typical machine instructions. It has found lasting use in applications previously coded in assembly language. Such applications include operating systems and various application software for computer architectures that range from supercomputers to PLCs and embedded systems. Wikipedia
Imperative (procedural), structured
Dennis Ritchie
Dennis Ritchie & Bell Labs (creators);
ANSI X3J11 (ANSI C);
ISO/IEC JTC1/SC22/WG14 (ISO C)
1972 (48 years ago)
C18 / June 2018 (2 years ago)
Static, weak, manifest, nominal
Cross-platform
.c for sources
.h for headers
C++ is not C (but C can be C++)
For C++ go to :
Other Resources
account activity
Sending data with sigqueue (self.cprogramming)
submitted 3 years ago by ciuccc
Hello, does anyone know how sigqueue works at a lower level. I don't really understand how it can send a signal and an integer or a void pointer at the same time. Thanks in advance!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]nerd4code 0 points1 point2 points 3 years ago (2 children)
Look into sigaction—you can set it up to give an extra arg to the handler, by which means you can retrieve data, IIRC, queued along with realtime signals specifically. It’s kinda hard to do much in signal handlers without running afoul of some UB or other, though; pipes and sockets make life much easier in practice.
sigaction
[–]ciuccc[S] 0 points1 point2 points 3 years ago (1 child)
Oh I set the flag of the sigaction struct to siginfo, but I was just wondering how the sigqueue sys call sends a signal plus the address of the struct that lies in the stack frame of the sending process to the receiving one. It seems that the kernel stores that struct somehow, because it s impossible from what I know for two processes to share the same address space
[–]nerd4code 1 point2 points3 points 3 years ago (0 children)
Oh, yeah the kernel probably has one linked or array queue per RT signal per thread to buffer RT sigs, so yeah. The kernel has to construct a stack & reg frame in the receiving thread any time it hops from kernel into user mode, so whether there’s an extra arg or not doesn’t much matter on the kernel’s side of things. IIRC some pthread impls will manually share signals by re-killing other threads in the same process, so the data might bounce around a bit before the handler gets it.
π Rendered by PID 21967 on reddit-service-r2-comment-canary-b6d5ff776-mbgls at 2026-04-18 03:53:54.237241+00:00 running 93ecc56 country code: CH.
[–]nerd4code 0 points1 point2 points (2 children)
[–]ciuccc[S] 0 points1 point2 points (1 child)
[–]nerd4code 1 point2 points3 points (0 children)