Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Status of POSIX implementations

Tags:

c

posix

I just found out that the getline() function which is originally a GNU extension is now part of the POSIX 2008 standard.

Is there some overview of how broadly is this version of POSIX supported?

like image 665
Šimon Tóth Avatar asked Apr 06 '11 11:04

Šimon Tóth


People also ask

Is POSIX still relevant?

Is POSIX still relevant? Yes: Standard interfaces mean easier porting of applications. The POSIX interfaces are widely implemented and referenced in other standardization efforts, including the Single UNIX Specification and the Linux Standard Base.

Is POSIX real-time?

The POSIX real-time extensions define real-time services such as real-time signals, real-time scheduling policies, task synchronization mechanisms, clocks, and timers. A real-time OS that is POSIX compliant typically implements both the core OS services and the real-time extensions, with the capability ...

Is POSIX compliant Windows 7?

The newest version is fully POSIX compliant and is (iirc) mapped more directly onto the Windows kernel than before, causing an increase in speed.


1 Answers

I would just go ahead and use it. It's possible to implement getline (but not the more powerful getdelim) as a very fast/efficient wrapper around fgets, so if you're willing to do that as a fallback, using getline doesn't really make your program any less portable. (Versus something like using __fpending, which cannot be implemented portably and requires an implementation-specific hack to emulate.)

Also, of course, both getline and getdelim can simply be implemented on top of flockfile/funlockfile and fgetc. It's not very efficient, but it will work anywhere.

like image 53
R.. GitHub STOP HELPING ICE Avatar answered Oct 06 '22 05:10

R.. GitHub STOP HELPING ICE