Questions tagged [posix]

POSIX (Portable Operating System Interface) is a set of standards defining programming APIs, a command interpreter, and common utilities for Unix-like operating systems.

POSIX (an acronym for "Portable Operating System Interface") is a family of standards that specifies the behaviour of Unix-like operating systems.

These standards define:

  • A standard operating system interface and environment
  • A programming API for the C programming language
  • The behavior of a command interpreter (or "shell")
  • The behavior of common utility programs invocable from the shell

The POSIX standards are developed by the Austin Common Standards Revision Group, a joint technical working group led by representatives from IEEE PASC, ISO/IEC JTC 1/SC 22, and The Open Group.

The current set of POSIX standards is available online.

POSIX is a trademark of the IEEE.

5973 questions
32
votes
3 answers

How to test if string matches a regex in POSIX shell? (not bash)

I'm using Ubuntu system shell, not bash, and I found the regular way can not work: #!/bin/sh string='My string'; if [[ $string =~ .*My.* ]] then echo "It's there!" fi error [[: not found! What can I do to solve this problem?
harryz
  • 4,980
  • 6
  • 31
  • 34
31
votes
3 answers

What is the difference between NPTL and POSIX threads?

What is the basic difference between NPTL and POSIX threads? How have these two evolved?
Whoami
  • 13,930
  • 19
  • 84
  • 140
31
votes
2 answers

Where is ssize_t defined in Linux?

OS: Debian 9 (Linux 4.9) Compiler: GCC 8.2 Currently I am including (where size_t is defined) and (where most integral types are defined), but I still don't have ssize_t. Where is it defined?
31
votes
5 answers

Setting creation or change timestamps

Using utimes, futimes, futimens, etc., it is possible to set the access and modification timestamps on a file. Modification time is the last time the file data changed. Similarly, "ctime" or change time, is the last time attributes on the file, such…
Thanatos
  • 42,585
  • 14
  • 91
  • 146
31
votes
7 answers

how do I parse an iso 8601 date (with optional milliseconds) to a struct tm in C++?

I have a string which should specify a date and time in ISO 8601 format, which may or may not have milliseconds in it, and I am wanting to get a struct tm from it as well as any millisecond value that may have been specified (which can be assumed to…
markt1964
  • 2,638
  • 2
  • 22
  • 54
31
votes
1 answer

Set and Oldset in sigprocmask()

I haven't completely understood, how to use sigprocmask(). Particularly, how the set and oldset and its syntax work and how to use them. int sigprocmask(int how, const sigset_t *set, sigset_t *oldset); Please explain with an example, to block, say…
Sushant
  • 1,013
  • 1
  • 11
  • 20
31
votes
3 answers

what is posix compliance for filesystem?

Posix compliance is a standard that is been followed by many a companies. I have few question around this area, 1. does all the file systems need to be posix compliant? 2. are applications also required to be posix compliant? 3. are there any non…
OpenFile
  • 669
  • 4
  • 8
  • 13
31
votes
2 answers

Is the shell's `source` POSIX-standard?

I've spent some quality time searching the POSIX standard for the shell for the source and . commands, and am at this point convinced that they're just not in there. Are there any shells that don't support the .? What is the POSIX-standard way of…
bk.
  • 6,068
  • 2
  • 24
  • 28
31
votes
5 answers

How can I determine if the operating system is POSIX in C?

Related questions How can I detect the operating system in C/C++? How can I find out what operating system I am running under in GCC or in ANSI C? I'd be fine If I can know if I'm running on POSIX. UPDATE: It doesn't make a difference to me…
historystamp
  • 1,418
  • 4
  • 14
  • 24
30
votes
4 answers

Why create system call is called creat?

Why create system call is called creat? Also, why a define for a buffer size is called BUFSIZ and not BUFSIZE? Are there any other such examples? Related: (taken from comments) What did Ken Thompson mean when he said, “I'd spell create with an 'e'.”
Roman Byshko
  • 8,591
  • 7
  • 35
  • 57
30
votes
4 answers

Who uses POSIX realtime signals and why?

I am not being flip I really don't get it. I just read a whole bunch of material on them and I can't figure out the use case. I am not talking talking so much about the API for which the advantages over things like signal() are clear enough. …
ValenceElectron
  • 2,678
  • 6
  • 26
  • 27
30
votes
1 answer

Android Lollipop 5.0.1 SQLiteLog POSIX Error 11 SQLite Error: 3850

I am having an issue while upgrading an app to support Android Lollipop. The app implements a SyncAdapter that writes on a db through a content provider. At the same time it can happen that the user is browsing the front-end of the app where loaders…
Luigitni
  • 572
  • 10
  • 18
30
votes
3 answers

Receiving warning "implicit declaration of function 'strlen'"

I have a some simple code, but I am receiving a warning: -bash-3.2$ gcc -Wall print_process_environ.c -o p_p print_process_environ.c: In function 'print_process_environ': print_process_environ.c:24: warning: implicit declaration of function…
Joe.Z
  • 2,725
  • 4
  • 25
  • 30
30
votes
1 answer

SO_REUSEADDR and AF_UNIX

The fact In the POSIX documentation, I can't see anything preventing the use of the SO_REUSEADDR socket option with AF_UNIX for UNIX Domain Sockets. However, it invariably fails at bind time if the socket node already exists, and seems to be ignored…
Hibou57
  • 6,870
  • 6
  • 52
  • 56
30
votes
3 answers

Using Auto and Lambda to handle Signal?

I have written this program that has a main function, inside which, I am creating two sockets, like this: int sockfd1 = socket(AF_INET, SOCK_STREAM, 0); int sockfd2 = socket(AF_INET, SOCK_STREAM, 0); Now I do some stuff with them, and when the user…
Subhamoy S.
  • 6,566
  • 10
  • 37
  • 53