The Single UNIX Specification (SUS) is a set of standards to qualify for name «Unix».
Questions tagged [sus]
15 questions
26
votes
4 answers
multiple threads doing poll() or select() on a single socket or pipe
What do POSIX and other standards say about the situation where multiple threads are doing poll() or select() calls on a single socket or pipe handle at the same time?
If any data arrives, does only one of the waiting threads get woken up or do all…

wilx
- 17,697
- 6
- 59
- 114
4
votes
2 answers
Does sigwait() behave differently in macOS and Linux?
I found the following code works differently in macOS and Linux:
#include
#include
#include
void catcher( int sig ) {
printf( "Signal catcher called for signal %d\n", sig );
}
int main( int argc, char *argv[] )…

diciotto
- 69
- 3
3
votes
1 answer
Is it a given or an assumption that all POSIX/SUS signals are a #define?
Signals differ between implementation. There are some nice tables in APUE (Advanced Programming in the Unix Environment), such as "Figure 10.1 UNIX System signals" on page 292 of the 2nd edition.
So let's take the exemplary SIGWAITING. Signals…

0xC0000022L
- 20,597
- 9
- 86
- 152
2
votes
1 answer
what's the portable way to reset getopt()?
i'm aiming the getopt() machinery at my own argv-like array, after having used it on the real argv. the interface is non-reentrant (holds state), and various implementations are reset in different ways.
in XPG3/SVID it's optreset = 1; (freebsd,…

Paul Vixie
- 171
- 1
- 4
2
votes
1 answer
Cross Platform Support for sprintf's Format '-Flag
The Single UNIX Specification Version 2 specifies the sprintf's format '-flag behavior as:
The integer portion of the result of a decimal conversion (%i, %d, %u, %f, %g or %G) will be formatted with thousands' grouping characters[1]
I can't find…

Jonathan Mee
- 37,899
- 23
- 129
- 288
2
votes
2 answers
FUSE's write sequence guarantees
Should write() implementations assume random-access, or can there be some assumptions, like that they'll ever be performed sequentially, and at increasing offsets?
You'll get extra points for a link to the part of a POSIX or SUS specification that…

Dustin Oprea
- 9,673
- 13
- 65
- 105
2
votes
0 answers
Using self-pipe, how can I avoid that the event loop stalls on read()?
I am trying to make use of the self-pipe trick to get a portable implementation (across Solaris, MacOSX, Linux, BSDs) of my application.
So in addition to the two pipes for stderr and stdout which I am using to fetch the output of the forked child…

0xC0000022L
- 20,597
- 9
- 86
- 152
2
votes
2 answers
Type definitions in POSIX/SUS headers
This question concerns the various types that need to be defined in the required headers of the POSIX/SUS standard.
Some types needs to be defined in many header files, and I'm wondering what's the correct and compliant way of achieving this.
For…

Macmade
- 52,708
- 13
- 106
- 123
1
vote
0 answers
When this interaction is running , others interactions dosen't being received
so, this is the code of the suspicious interaction code:
https://srcb.in/s6MOIk9S89
so when the suspicious code running, the bot can't received any other interaction failed:
https://i.ibb.co/2d8By3v/Screenshot-20220417-145902.jpg
and after i restart…

LegendaryPepe
- 25
- 1
- 6
1
vote
2 answers
Is it legit to share the buffer used for stdio buffering between parent and child process?
I was wondering whether it would be legit to allocate a buffer for stdio stream buffering and use it with setvbuf (before fork), where the buffer is an anonymous mmap-"allocated" piece of memory shared between parent and child process?
Assuming the…

0xC0000022L
- 20,597
- 9
- 86
- 152
1
vote
1 answer
How to portably check extremal values for SuSv3 data types?
By SuSv3, ssize_t is required to be a signed integer type. If I want to check if a value I calculate is larger than the maximal value allowed for such a data type, I could compare it to INT_MAX, which isn't nice.
Is there a more portable way this…

gnometorule
- 2,151
- 2
- 20
- 29
0
votes
1 answer
File mode flags S_IRUSR, S_IRUSR.... definitions
Where can I find the definitions for file mode flags such as S_IRUSR, S_IRUSR, S_IROTH.. etc...?
I looked on sys/stat.h but couldn't find the same?

Killbill
- 37
- 1
0
votes
1 answer
Allowing %n$ operand for custom printf
I have a custom implementation of printf which I use in my school projects.
Wishing to have the same warnings that printf, I use __attribute__((format (printf ...)). That works fine, but using -Wall -Wextra -Werror -std=c11 -pedantic-errors, I get…

VannTen
- 441
- 2
- 12
0
votes
1 answer
Can I assume stdio streams point to the correct file descriptor after a dup2?
I have code where I want to encapsulate a particular piece of code into a forked child so that if the code causes issues, it will not affect the parent and the parent will be able to report.
I am not execing after the fork call. Just plain fork and…

0xC0000022L
- 20,597
- 9
- 86
- 152
-1
votes
1 answer
How to implement ssh over XMPP, by C programming?
I write xmpp bot in linux that invoke remote shell for me.
Any one could intoduce my which technologies should I know about them, to write this program?

Milad Khajavi
- 2,769
- 9
- 41
- 66