Slashdot Mirror


LSB & Posix Conflicts

An anonymous reader writes "The OpenGroup has published a detailed list of the conflicts between the Linux Standards Base and Posix ? that is accessible through their website. "

354 comments

  1. POSIX is required! by Anonymous Coward · · Score: 3, Insightful

    These need to addressed since POSIX is more important than LSB. The LSB should be modified.

    1. Re:POSIX is required! by Anonymous Coward · · Score: 0

      Hear! Hear!

      Or maybe LSB should be eliminated in favor of Posix. It always struck me as bizzare that the Linux community to create a (free unix | clone of Unix) and didn't go with the Posix standard from the beginning. Lets spend hundreds of thousands of man hours to create a free, highly capable operating system which is modeled after Unix but which has gratuitous differences thrown in which make it harder to integrate into Unix networks and causes confusion. Or maybe someones just trying to create GNU/Posix.

      Maybe at the same time they can take a look at OS vs Application packaging. Stuffing world + dog into /usr/bin isn't a good thing.

    2. Re:POSIX is required! by pmsyyz · · Score: 5, Insightful

      Ask yourself this: can you read a copy of the POSIX standards online?

      No, that's why Linus couldn't implement it fully.

      --
      Phillip
    3. Re:POSIX is required! by Anonymous Coward · · Score: 0

      Actually none of these differences make a Linux box hard to integrate into a _network_.

      In fact, most of these changes make a linux box work better by default.

      Ask your Unix vendor to meet the LSB.

    4. Re:POSIX is required! by __past__ · · Score: 4, Interesting
      San Francisco, CA - January 30 2002- The Open Group announced today completion of the joint revision to POSIX® and the Single UNIX® Specification. The new standard is now available at http://www.UNIX-systems.org/version3/ in keeping with The Open Group's policy of open and free access to its standards.
      As far as I can see, all that is required is a free registration. Am I missing something?
    5. Re:POSIX is required! by Anonymous Coward · · Score: 0
      Actually you can read the posix standard online.


      Maybe Linux can't figure out how to get linux connected to the 'net either?

    6. Re:POSIX is required! by pmsyyz · · Score: 1

      Ok, so now they are online. A few years too late, but I'm glad to see it.

      --
      Phillip
    7. Re:POSIX is required! by pmsyyz · · Score: 5, Informative

      2002, great, too bad it wasn't available in 1991.

      From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
      Newsgroups: comp.os.minix
      Subject: Gcc-1.40 and a posix-question
      Message-ID:
      Date: 3 Jul 91 10:00:50 GMT
      Hello netlanders,

      Due to a project I'm working on (in minix), I'm interested in the posix standard definition. Could somebody please point me to a (preferably) machine-readable format of the latest posix rules? Ftp-sites would be nice.

      A month later, Linus posted:

      As to POSIX, I'd be delighted to have it, but POSIX wants money for their papers, so that's not currently an option.

      This June 1999 article is good: The Past and Future of Linux Standards

      Also, this Dec 2000 interview with Linus touches on Linux and POSIX/LSB standards.

      To sum it all up: POSIX is good, LSB is good, let's work together towards world peace.

      --
      Phillip
    8. Re:POSIX is required! by Rares+Marian · · Score: 2, Interesting

      POSIX SHMOSIX! (no offense to mosix developers)

      POSIX was designed back when they had to limit the length of strings because hardware was expensive. POSIX and LSB, sadly, happen to be the most nitpicking standards I've seen to date.

      I intend to support the LSB, but give me innovation over a decaying standard. Do we want the Linux kernel to look like the x86 chip design?
      Your P4 and Athlon can run code written for stop lights (Intel was in the stop light biz before the personal computer).

      Besides with so many differences, can SCO or MS really claim Linux has copied code?

      --
      The message on the other side of this sig is false.
    9. Re:POSIX is required! by Creepy · · Score: 1

      I was under the impression that the POSIX functions and programs were all defined and obtainable (probably through mail in the past, now online), but the actual compliancy tests themselves were proprietary and cost lots of money (and very secret).

      In the early days of Java I read something about how the POSIX and Java models were similar for compliance testing. I have no idea if that is true anymore, as I haven't used Java since about the time I read that article :P

    10. Re:POSIX is required! by lokedhs · · Score: 1
      POSIX was designed back when they had to limit the length of strings because hardware was expensive. POSIX and LSB, sadly, happen to be the most nitpicking standards I've seen to date.
      You can't have seen many standards then. Case in point: ISO-9899 (a.k.a. ISO-C).
    11. Re:POSIX is required! by Anonymous Coward · · Score: 0

      http://www.opengroup.org/onlinepubs/007904975/toc. htm

      No registration required! ^_^

    12. Re:POSIX is required! by Rares+Marian · · Score: 1

      Ok. I'll write a meta standard. THey'll have to pull the bats out of their asses sooner or later.

      --
      The message on the other side of this sig is false.
    13. Re:POSIX is required! by Anonymous Coward · · Score: 0

      So that's why traffic flow on the little street breaks up light synchronization on the big street -- it's more x86 ISA braindamage.

    14. Re:POSIX is required! by lokedhs · · Score: 1

      I have absolutely no idea what you were trying to say. However, I think it's a good thing.

    15. Re:POSIX is required! by Alain+Williams · · Score: 1

      Yes, POSIX is required, and backards compatability is required. One of the nice things about Unix/Linux is that I can (with a quick compile) run programs that I wrote 10 years ago, and with minor tinkering ones that I wrote 20 years ago.

      That is great. If I write small utilities - I don't want to spend time rewriting them.

    16. Re:POSIX is required! by Rares+Marian · · Score: 1

      Oh so you're the one holding us back?

      --
      The message on the other side of this sig is false.
    17. Re:POSIX is required! by bedessen · · Score: 1

      And the lack of availability in 1991 affects the current releases how? "Uh, but it wasn't available when linux was being designed." Ask yourself, how many times have things been redesigned, how many internal interfaces been reworked since v0.1? This argument that because it wasn't online in 91 (what WAS online in 91?) that somehow that affects current compliance is really kind of pushing it.

  2. UNIX standards base by Anonymous Coward · · Score: 2, Funny

    Perhaps we should just have a UNIX Standards BASE or USB.... oh wait..

    1. Re:UNIX standards base by Surak · · Score: 1, Funny

      Well, there is the older standard, POSIX Standards/2 (or PS/2)...

    2. Re:UNIX standards base by lightcycle · · Score: 1

      Yes, and perhaps USB high compliance and USB full compliance

      --

      The stars that shine and the stars that shrink
      in the face of stagnation the water runs before your eyes
  3. POSIX LSB by Gorny · · Score: 5, Insightful

    IMHO it's better for GNU/Linux (never know if rms is watching ;) to comply to the older POSIX standards than a nice utopian LSB. I doubt if it will ever get of the ground since the whole Linux distro's are so scattered and divided (let alone the commmercialization of certain products).

    btw. check the following for more information on POSIX
    http://www.posix.com/
    http://standards.iee e.org/regauth/posix/

    --
    Alan Perlis once said: "A language that doesn't affect the way you think about programming, is not worth knowing"
  4. Rationale by sql*kitten · · Score: 5, Interesting

    Can someone familiar with the decision making process post a summary of why the LSB group simply didn't choose to implement POSIX rather than creating their own standard?

    I've read most of the article, and while there are some things that were clearly (and subjectively) chosen by the LSB group as being "better" (line 123, for example), others appear to be technical limitations (line 219, for example) and some are purely arbitrary (for example line 282).

    A lot of time and experience went into creating POSIX, and on the whole it's pretty sound. It seems a shame not to leverage it, both from an academic perspective, and also because lack of POSIX-compliance is a barrier to porting existing applications to Linux.

    1. Re:Rationale by doug · · Score: 1

      Wasn't Linux originally billed as a free POSIX compliant OS? I don't remember this changing, but I don't spend a lot of time keeping up with these things.

      Although I think POSIX has some flaws, it is much better than what came before it (unix vendor hell). POSIX should be followed unless there is a good reason not to.

      Remember this is how we have applications that flow back and forth from Unix without problems. Although I don't use Solaris at this job (I'm suck with XP), when I do use Solaris, step one is to grab lots of useful software. POSIX is what allows the developpers to gloss over the differences between Linux and Solaris. This is a good thing. Remember the kernel is nice, but applications are what we really use.

      - doug

    2. Re:Rationale by BJH · · Score: 5, Interesting

      They chose not to implement POSIX because of things like this:

      259 The files at.allow and at.deny reside in /etc rather than /usr/lib/cron
      260 on LSB implementations.


      Why, for the love of God, would you want them under /usr/lib/cron, of all places?!

      Face it, POSIX is just broken in some areas.

    3. Re:Rationale by DarkMan · · Score: 3, Insightful

      Because that's where they belong?

      Or, alternativly, why not? If it's just because your not used to it, then ponder it a bit more.

      if /usr/lib/prog stored all the information that prog required, then it would be simpler to cleanly uninstall, and to bundle, a working application.

      Why not reserve /etc for system-wide configuration, and put program specific information somewhere where it is clear that it's program specific?

      Is there a good reason that configuration data must be all the way across the filesystem from the rest of the program? If you have a range of different machines, doing different tasks, all using one program in different manners, and NFS mount /usr, then yes. Note that this approach would have a program reside entierly reside in /usr/lib/prog, except for the primary binary, which would be in /usr/bin.

      Now, POSIX may be broken because it's inconsitant (some per-prog configuation in /etc, some in /usr/lib/prog), but that's a seperate issue.

      One big advantage of this approach would be for a large number of systems, that NFS mount /usr. Now, in order to update the program, or to adjust it's settings, you change one set of files, and it is automatically replicated, throught the NFS mounts. If the configureation was seprate, then a new version that required a change in configuration files would result in having to change the file on all the machines, or some ugly hack invloving lot's of symlinks in /etc. And hope that you never have to add a new program to /usr, or it's time to go around all the boxes manually again. This sort of configuration is desirable on Beowulf clusters.

    4. Re:Rationale by scrytch · · Score: 1

      > Why, for the love of God, would you want them under /usr/lib/cron, of all places?!

      at was (still is sometimes) implemented in terms of cron. It made sense to keep cron's stuff together. I agree, it's an idiotic place, but there should be symlinks.

      Putting them directly in /etc and not /etc/cron, incidentally, sucks. Directories are nice things, let's use them. Aside from keeping things nice and pretty, it would allow using some sort of remotable config database mounted as a directory, without having to move all of /etc to such a scheme or having to pull some sort of weird union mount (not available on Linux) trick. This of course assuming that lightweight usermode filesystems could be a reality on Linux...

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    5. Re:Rationale by BJH · · Score: 1

      Actually, the equivalent of union mount is available on Linux, implemented by Al Viro IIRC.

    6. Re:Rationale by BJH · · Score: 3, Informative

      Why not?

      Well, how about if you want to mount /usr readonly? If you've got files that could change during operation on that partition, you're stuffed.

      BTW, installation/uninstallation of an app is the job of the package manager, not the user. If the PM knows what files belong to what package, what real advantage is there to having everything for that app under on directory?

    7. Re:Rationale by simm_s · · Score: 1

      If memory serves me right, Linux was not POSIX compliant from the beginning. The LSB is really a standard for Linux distribution makers to follow so that when application designers make a linux application, it can run across distributions with minimal changes.

      The GNU extenstions to the standard UNIX commands were in widespread use across distributions before the LSB was created. If the LSB group decided just to implement POSIX, it would force the distribution makers to modify all of the applications or utilities that are not POSIX compliant in thier distribution. This of course would never happen, so the LSB logically decided to base the standard on what was in common use.

      In other words, no one would use POSIX because it would force code rewrites, therefore no one would use LSB if it were strictly based on POSIX.

    8. Re:Rationale by greenrd · · Score: 1
      Oh really? Where can I download it?

      I've been using plasticfs to do that.

    9. Re:Rationale by Tokerat · · Score: 1

      BTW, installation/uninstallation of an app is the job of the package manager, not the user. If the PM knows what files belong to what package, what real advantage is there to having everything for that app under one directory?
      Having everythign scattered everywhere is the very reason Windows is such a goddamn mess, that's why.
      --
      CAn'T CompreHend SARcaSm?
    10. Re:Rationale by Anonymous Coward · · Score: 0

      A better place than /etc (which contains enough stuff as is) or /usr (which is indeed inappropriate for configuration information) would perhaps be under /var.

    11. Re:Rationale by pjrc · · Score: 1
      Quoting...

      One big advantage of this approach [at.allow, at.deny in /usr/lib/cron (posix) rather than /etc (lsb)] would be for a large number of systems, that NFS mount /usr. Now, in order to update the program, or to adjust it's settings, you change one set of files, and it is automatically replicated, throught the NFS mounts.

      Many environments would want to allow certain users to run jobs automatically on their machines, without globally granting them that privledge on every other machine in the company, department, university, etc.

      Continuing quoting...

      If the configureation was seprate, then a new version that required a change in configuration files would result in having to change the file on all the machines, or some ugly hack invloving lot's of symlinks in /etc. And hope that you never have to add a new program to /usr, or it's time to go around all the boxes manually again.

      Many solutions exist for administrating /etc files, to merge a global configuration with per-machine specific settings.

      Sure, as an administrator, maybe the world revolves around making your job as easy as possible. I know it's hard to think of the bigger picture, especially for some heavily overworked admins, but computers don't exist and we don't all use them to cater to the whims of admins.

      Computers are tools that are used to get real work done (well, some people also play games or entertain themselves, but rarely are admins paid to support those activities).

      What matters is a useful configuration that facilitates real people using their computers to do real work, which ultimately furthers the mission of the company/organization paying for the computers and system admin(s).

      In this case, the LSB decision allows a read-only global NFS mount of /usr and avoids placing configuration files there that will likely need to be different amoung different machines.

    12. Re:Rationale by Suicyco · · Score: 1

      Hmm, having security critical files such as at.allow and at.deny on a read only filesystem... interesting...

    13. Re:Rationale by Rares+Marian · · Score: 1

      That's why people use directory services.

      Changing configurations on all machines might be necessary for example not every machine has the same video hardware.

      Like I keep saying POSIX and LSB both need to have the ability to override the standard with standard overrides.

      Suggestions: /etc for local default options /usr/etc for default application settings /usr/lib/prog/ for application overrides /home/.prog/ for user overrides

      --
      The message on the other side of this sig is false.
  5. Re:POSIX LSB by Anonymous Coward · · Score: 2, Funny

    Ahem. That's GNU/GNU/Linux, GNU/Posix, GNU/LSB, and GNU/Linux GNU/Distros. And the first word should be IMHGNU/O. So there. :-P

    -- rms

  6. Goldilinux and the three bears... by Black+Parrot · · Score: 5, Funny


    SCO: "Too similar"
    TOG: "Too different"
    LSB: "Just right!"

    --
    Sheesh, evil *and* a jerk. -- Jade
    1. Re:Goldilinux and the three bears... by Anonymous Coward · · Score: 0

      BBW: Then I'll sue, and I'll FUD till I own your IP!

  7. gets() by Genghis+Troll · · Score: 4, Funny

    107 The LSB has deprecated the gets() function, whereas it is a first
    108 class function in ISO/IEC 9945 and ISO/IEC 9899.


    Won't somebody think of the script kiddies!
    1. Re:gets() by Gorny · · Score: 2, Insightful

      No programmer in their right mind uses the I/O POSIX functions without checking the user input. Too bad there are still very common buffer overflows, format strings and heap overflows found in (more or less major) projects.

      --
      Alan Perlis once said: "A language that doesn't affect the way you think about programming, is not worth knowing"
    2. Re:gets() by Anonymous Coward · · Score: 0

      It's O.K, they still have the non-delimited string.h favourites such as strcpy() and strtok()!

    3. Re:gets() by Surak · · Score: 2, Funny

      No programmer in their right mind uses the I/O POSIX functions without checking the user input. Too bad there are still very common buffer overflows, format strings and heap overflows found in (more or less major) projects.

      I do, but then again, I'm working on a project that requires Windows compatibility. ;)

    4. Re:gets() by BetaJim · · Score: 3, Interesting

      Yep, I saw this and thought that deprecating gets() is one thing the LSB shouldn't change. While there are valid points in the article, this is one I would contest. gets() is such an easily misused function that it needs to be deprecated. I think the current behavior of the linker issuing a warning when this function is used is a great thing.

      --

      "Drug related crime" is a misnomer, "prohibition related crime" is the more accurate and correct phrase.

    5. Re:gets() by Gorny · · Score: 1

      It cant be that hard to write your own little library with strncpy etc to make them available under Windows. Give it a shot, especially when your not validating the user input.

      --
      Alan Perlis once said: "A language that doesn't affect the way you think about programming, is not worth knowing"
    6. Re:gets() by drakoo · · Score: 3, Interesting

      It seems that POSIX is so deprecated that they haven't removed gets().
      LSB is going to be more important than POSIX.
      Even right now, Unix developers consider more important being Linux compatible than being POSIX compatible.

    7. Re:gets() by quigonn · · Score: 2, Interesting

      Actually, glibc only uses linker warnings for a few functions. In contrast, dietlibc warns of many other functions, e.g. unportable functions like sendfile, security risks like system and {tmp,temp}nam, functions introducing bloat into your programs like all stdio stuff, and so on.

      --
      A monkey is doing the real work for me.
    8. Re:gets() by arkanes · · Score: 1

      It'd be especially easy, as MS provides a safe string library with newer versions of the SDK. You shouldn't use Posix I/O under Windows, write a library to provide you with a single api targeting the safe IO under Windows or Linux if you need to (I'm sure you can find one already created - check the Mozilla project for starters).

    9. Re:gets() by NightSpots · · Score: 2, Insightful

      So it's better to be compliant with a single operating system than an open, published standard? It's OK to go against the standard, because your way is better and developers will still write code for your operating system?

      Is that really what you're saying?

      Someone inform Microsoft, they were right all along.

    10. Re:gets() by ebresie · · Score: 1

      Any good referenencs, books, links, etc that you can suggest to point out what kind of things "programmer(s) in their right mind uses" to avoid these type of problems??

      I'm sure there are a lot of folks out there that are not as wise as many of the programming gurus out there, that could benefit from such information.

      --

      Eric B
      ebresie@gmail.com
    11. Re:gets() by Nevyn · · Score: 1
      In contrast, dietlibc warns of many other functions, e.g. unportable functions like sendfile, security risks like system and {tmp,temp}nam,

      Great so if you autoconf for sendfile() then you still get a warning, how intelligent. system() is debatable, I'd say it was rarely used and rarely used badly ... however tmpname/tempname both produce link warnings with glibc.

      functions introducing bloat into your programs like all stdio stuff

      *laughs* ... yeh, because almost no C programs use stdio. Mind you due to the terrible printf in dietlibc a link time warning for printf/sprintf/fprintf/etc. is probably a good thing.

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    12. Re:gets() by kasperd · · Score: 1

      So it's better to be compliant with a single operating system than an open, published standard?

      Is LSB not published? Is POSIX more open than LSB?

      --

      Do you care about the security of your wireless mouse?
    13. Re:gets() by johnnyb · · Score: 1

      I agree with your sentiments, but, contrary to popular belief, Linux is NOT a single operating system. Linux is a single kernel that runs several different operating systems.

    14. Re:gets() by Nevyn · · Score: 1

      *sigh* that link should be... this one

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    15. Re:gets() by NightSpots · · Score: 1

      Yes, LSB is published.

      Yes, LSB is open.

      But remember, LSB refers to a single operating system, that OS being (as it's name states) Linux.

      It completely ignores FreeBSD, OpenBSD, NetBSD, Darwin, Solaris, and even Windows NT (which has limited POSIX compatibility). Is that really what you want?

    16. Re:gets() by kasperd · · Score: 1

      But remember, LSB refers to a single operating system, that OS being (as it's name states) Linux.

      I don't know the details of LSB. Would it be any problem to make for example one of the BSDs compliant with LSB?

      --

      Do you care about the security of your wireless mouse?
    17. Re:gets() by NightSpots · · Score: 1

      Problem? It wouldn't be technically difficult, but it would never happen. The philosophies are different. BSDs are trying to get more and more POSIX compliant, in order to better co-exist with commercial variants of Unix. You'd have to find a BSD committer who would be willing to throw away compliance with every other POSIX operating system in order to be compatible with Linux. I don't think that is going to happen.

      Rather, what you'll see are authors of programs with a few dozen #ifdef's around differing sections. I see it a lot (mostly because I use networking code more than say, desktop code) in gethostbyname() calls, where there's at least three versions depending on OS, and Linux is one by itself.

  8. To resolve which standard is preferred... by Satan's+Librarian · · Score: 1

    I think the Mutual Standards Base should be created from the best of both.

    1. Re:To resolve which standard is preferred... by Anonymous Coward · · Score: 0

      Yeah, and lets do eveything the way the LSB does it and call it the LSB. Oh good, we're done.

    2. Re:To resolve which standard is preferred... by pla · · Score: 1

      I think the Mutual Standards Base should be created from the best of both.

      Oh, good... Someone else who read the title and thought it referred to some problem between endianness and POSIX. ;-)

      (Don't know if anyone else will notice you meant that as a joke, though...)

    3. Re:To resolve which standard is preferred... by cant_get_a_good_nick · · Score: 1

      The best thing about standards is that there are so many to choose from?

    4. Re:To resolve which standard is preferred... by Satan's+Librarian · · Score: 1
      Yeah, no funny mods :(

      With only 17576 different 3-letter acronyms available, it's long past time to switch to four or five letter ones for new stuff... Even within just the programming field it's enough to make my head hurt reading stuff some days...

  9. Nothing major by Anonymous Coward · · Score: 5, Informative
    Most of the differences fall into two catagories:
    1. The LSB spec is a sub-set of the required POSIX implementation (E.g. PThreads)
    2. The LSB spec has pulled in some extra GNU functionality (E.g. getopt(), extra flags to a few shell utilities)
    None of this seems to major however. Some of it even seems sensible (E.g. the LSB deprecates gets()) Some of it is dangerous though. This is especially true where the LSB and POSIX spec defers on things such as ioctl() and system() In these cases, LSB needs to come into line with POSIX, or at least support the LSB implementation as a superset of POSIX.

    Some of the LSB PThreads stuff could be anoying, but currently very few implementations of PThreads are feature complete anyway. LSB and Linux have just as much chance as anyone else to bring themselves into line with POSIX.

    Nothing too shocking, but it could be a handy reference. If in doubt though, stick with POSIX.
    1. Re:Nothing major by Bob+Uhl · · Score: 1
      The major problem is that ranges are allowed to be in code point order rather than collation order. This breaks the expected behaviour, learned by many of us and relied upon by scripts since time immemorial, of such utilities as grep, sed, awk, tr &c. [a-z] no longer indicates abcdefghijklmnopqrstuvwxyz, but some non-useful collection of characters. This has caused me no end of trouble on RedHat 9, which sets LANG to en_US.UTF-8

      Yes, character classes are The Right Thing for much of this sort of thing anyway--but this behaviour is The Wrong Thing regardless. It's not what one would intuitively expect, and it's not particularly useful. It breaks a lot of things, and doesn't really enable anything that I can see. I could be wrong; it could be brilliant, and I'm missing some vital datum. Don't think so, though.

  10. Affected C functions by Rosco+P.+Coltrane · · Score: 5, Funny

    099 2.1.2 gethostbyname [...]
    102 2.1.3 getopt [...]
    106 2.1.4 gets [...]
    109 2.1.5 getservbyname [...]
    112 2.1.6 getservent [...]
    115 2.1.7 ioctl [...]
    120 2.1.8 iswctype [...]
    123 2.1.9 kill [...]
    133 2.1.10 nice [...]
    139 2.1.11 opterr, optind, optopt [...]
    142 2.1.12 strptime

    Pfff, we're saved. printf("Hello world\n") will still work on all platforms. Isn't it the standard portability test after all?

    --
    "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
    1. Re:Affected C functions by warrior_on_the_edge_ · · Score: 1

      Pfff, we're saved. printf("Hello world\n") will still work on all platforms. Isn't it the standard portability test after all?

      Doesn't this fail the microsoft portability test?

    2. Re:Affected C functions by __past__ · · Score: 2, Informative

      Even if not, GNU has helpfully published a version of "Hello, World!" that uses autoconf, so it's quite easy to work around incompatibilities if the GPL isn't a problem for your project. It doesn't seem to be actively maintained at the moment, however, the current version 2.1.1 is over a year old.

    3. Re:Affected C functions by p3d0 · · Score: 1
      Good God, it's 380KB zipped.

      Also, the code is ugly as hell. That seems to be the case for all the GNU code I have seen. (Thanks, RMS, for donating this stuff to the world, but man, it's ugly on the inside.)

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    4. Re:Affected C functions by Anonymous Coward · · Score: 0

      #if defined(__GNU__)
      #include <gnu.h>

      static int __attribute__ (foo) bar = 0;
      int ret = 0;
      if ( 0 == bar )
      {
      fprintf(stdout, "I don't know what you're talking about!\n");
      __magic_inline_function_you_cant_find( bar, baz, MAGIC0 );
      }
      else
      {
      fprintf(stderr,"This isn't right\n");
      __some_macro_you_cant_tell_from_an_inline( "Oh!" )
      }

      return( ret );
      #else
      printf("Oh thank God, some normalcy!\n");
      return( 0 );
      #endif

    5. Re:Affected C functions by AJWM · · Score: 2, Funny
      Good God, it's 380KB zipped.

      Yeah, but check the description page to see why:

      "Yes, this really is the classic program that prints "Hello, world!" when you run it. Unlike the elementary version often presented in books like K&R, GNU hello processes its argument list to modify its behavior, supports internationalization, and includes a mail reader."
      (emphasis added).

      Who was it that said something about every program tending to add features until it includes a mail reader?

      --
      -- Alastair
    6. Re:Affected C functions by p3d0 · · Score: 1

      I bet you one million dollars I can write a mail reader in less than 380KB sipped.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  11. Re:How about making more Distros comply first. by Surak · · Score: 0, Interesting

    The biggest violator is Debian gnu/linux. It uses an outdated kernel (violation, the standard specifies 2.4.19 and above), a non standard implementation of X (A hacked version of 3.3.6 to use X4 modules), A propeirtry (as in incompatible, not as in closed) package format known as dotdebs (RPM is the official standard). Uses an outdated file system (it uses ext2, the offical filesystem is reiserfs). Uses EMACS as its text editor (the offical one is vi for the console and kate for X) and finally it uses gnome as its default window manager (the offical standard mandates kde)

    These decisions regarding implementation and USER PREFERENCE are mandated by LSB? You're kidding right?

  12. Oops by KillerHamster · · Score: 1, Funny

    We had better fix this. I'll go ask SCO what to do.

    1. Re:Oops by Rogerborg · · Score: 0, Offtopic

      > We had better fix this. I'll go ask SCO what to do.

      SCO: All your Linux Standard Base are belong to us.

      --
      If you were blocking sigs, you wouldn't have to read this.
  13. POSIX,LSB,BSD,heck, where is everything? by Lumpy · · Score: 4, Interesting

    My biggest problem is the fact that the different distros think that Foo needs to be in different locations. It has became better of late but it is still unacceptable that Redhat thinks that X, apache,samba,etc... need to be installed somplace different than everyone else, and everyone thinks that the origional creators are twits and NEVER uses the correct install locations.

    Under BSD it seems to be better between the 2 net/free but could suffer the same fate as others start thinking of making their own flavors...

    I want apache to be in the same place on every damn distro.... is it really that difficult to not screw with an install of a app?

    --
    Do not look at laser with remaining good eye.
    1. Re:POSIX,LSB,BSD,heck, where is everything? by ninthwave · · Score: 4, Interesting

      You are probably more inclined to than look at this project than POSIX compliance different issue altogether though within the scope of LSB.

      POSIX compliance is mainly in the API
      while the directory layout is a matter the LSB is approaching it is not part of POSIX specification except for some directories that must exist.
      Detail

      --
      I was thinking of the immortal words of Socrates, who said: "I drank what?" - Chris Knight (Val Kilmer)- Real Genius
    2. Re:POSIX,LSB,BSD,heck, where is everything? by W2k · · Score: 1, Interesting


      C:\Program Files\

      Yet another problem of something Windows got right from the start (a default place to install everything) but which (most distros of) Linux are still struggling with.

      --
      Quality, performance, value; you get only two, and you don't always get to pick.
    3. Re:POSIX,LSB,BSD,heck, where is everything? by __past__ · · Score: 1
      Won't happen, ever. There are reasons for the differences. For example, OpenBSD stores config files of third-party apps in /etc, FreeBSD in /usr/local/etc - there are good arguments for both ways (basically "all config files should be in one location where you can easily find them all" vs. "there should be a clear distinction between the base system and arbitrary third-party stuff").

      Another problem is non-free software where you don't really have a choice where to put stuff, especially when the author(s) insist on a really weird interpretation of the Unix file system hierarchy. This can badly mess up your carefully organized system. Qmail and other D.J. Bernstein software is the prime example.

    4. Re:POSIX,LSB,BSD,heck, where is everything? by C.+E.+Sum · · Score: 1

      Well, except for DLL's and the occasional misbehaved uninstaller.

      But, of course, that's not Microsoft's fault.

      --
      -- Have you ever imagined a world with no hypothetical situations?
    5. Re:POSIX,LSB,BSD,heck, where is everything? by wfberg · · Score: 4, Informative


      C:\Program Files\


      Ok, is explorer.exe in C:\Program Files\Microsoft\Windows\Explorer\ ? Or in C:\Windows\ ? Or in C:\Windows\System32\? Or in C:\Program Files\Explorer\? And where's iexplore.exe ? Where's the uninstaller for FooSoft Bar? C:\windows\unwise.exe ?

      Now go and find those settings. Are they in C:\Documents and Settings\Windows User\Application Data\ ? Are they in C:\Program Files\Foo\Bar.ini ? In win.ini? Are they in the registry in HKLM? Or in HKCU? Or even in HKU\.DEFAULT? Or in a group policy? Or in a custom policy? Somewhere in Active Directory?

      Where does iexplore put it's cache? How about MSIE 4? How about 5? How about if you run ME? in C:\Windows\Cache ? In c:\Documents and Settings\Windows User\Local Settings\Temp? Win98x doesnt even have C:\Documents and Settings!

      When is %windir% C:\windows and when is it c:\winnt? Why is %windir% even an environment variables, people fuck with those!

      Windows paths are a great big piling heap of.. Well, something unpleasant. And the registry doubly so. Granted, the *nix way of doing things isn't perfect, but at least it had homedirectories(!) with .apprc settings ages ago.

      --
      SCO employee? Check out the bounty
    6. Re:POSIX,LSB,BSD,heck, where is everything? by Anonymous Coward · · Score: 0

      I don't think that's quite what he was talking about. The difference between /etc/ and /usr/local/etc is basically an administrative standpoint. But it's different with Red Hat. Why are the apache html files stored in /var/www ? Why is the config stored in /etc/http/conf/ ? Some of these things just don't make any sense no matter how you look at it.

    7. Re:POSIX,LSB,BSD,heck, where is everything? by Clover_Kicker · · Score: 2, Informative

      >something Windows got right from the start

      Hahahahahhahaha, guess you didn't have to support anything prior to Win95.

      Right from the start. ROTFL!

      Mind you, that was the least of the problems with Win3.x, but your statement is just silly.

    8. Re:POSIX,LSB,BSD,heck, where is everything? by Sique · · Score: 1

      No, it is C:\Programme\.

      What? You are NOT using the german version?
      I hate it when programs never check for the default install path and just hardcoded assume, it would be C:\Program Files\.
      And I am pretty sure, it would be something like C:\Fiches des Programmes\ in the french version.

      Don't tell me, Windows got it right from the start. They messed it up like everyone else. And this in the same company.

      --
      .sig: Sique *sigh*
    9. Re:POSIX,LSB,BSD,heck, where is everything? by Peter+Harris · · Score: 1

      Ironically, your .sig calls for a group of geeks to stand up for what
      they believe in.
      Note that the Debian project is just that, and Debian has probably the
      most consistently well-thought out policy for where and how everything gets
      installed.
      The only problem is, it's different from everyone else's. Still, it
      works. If what you were suggesting is all Linux distributions aim for
      compliance with Debian policy, I'm behind you all the way. Or ahead of
      you, whatever ;)

      --

      -- What do you need?
      -- Gnus. Lots of Gnus.
    10. Re:POSIX,LSB,BSD,heck, where is everything? by arkanes · · Score: 1
      In fairness, MS is working in this, even though they themselves fuck with it :P.

      Oh, and you shouldn't use %windir% except in shell scripting, there's an API call to get the Windows directory. (Also home directory, temp directory, etc).

    11. Re:POSIX,LSB,BSD,heck, where is everything? by Anonymous Coward · · Score: 0

      echo %ProgramFiles%
      C:\Program Files


      Can't blame Microsoft if a non-Microsoft developer chooses to ignore the standards. Of course you can blame if they ignore their own standards.

    12. Re:POSIX,LSB,BSD,heck, where is everything? by Zapman · · Score: 1
      Where should apache go?

      /var is for variable data. While web pages change, it's not exactly 'variable'.

      /usr is good for the binaries, but the data is updated too much. Besides, it's common to mount /usr read only for security reasons.

      /opt? That's for package data. An apache package could live there, but again the data changes, and opt could be mounted read only for the same reason /usr is.

      /home? doesn't really fit either. There's a apache user for it, but it doesn't give multiple users easy access to the data. Besides, it's common (sorta) to mount /home with no_exec. So much for php, or perl.

      So where should the data files for all applications live? There's not really a good place for them.

      The only thing that someone can do cleanly is to have a seperate disk volume for that application (or several volumes). Call it /apache or /web.

      I personally keep DNS data in /var/named, but I really shouldn't for the same reasons apache data shouldn't live there. I only do it because everyone else does.

      --
      Zapman
    13. Re:POSIX,LSB,BSD,heck, where is everything? by Larsing · · Score: 1

      Except when it's C:\Program\ as it is in some international versions, or if you are dual booting DOS and NT (yes, I'm a sick fschk, but old Mircoprose games won't run in emulation mode) D:\Program\ or D:\Program Files\

      --
      Ethics is what you say you do. Morals is what you actually do.
    14. Re:POSIX,LSB,BSD,heck, where is everything? by Minna+Kirai · · Score: 1

      C:\

      Yet another problem of something DOS got right from the start.

      (a default place to install everything)

      Unless you're Microsoft, of course. Then you can put Excel in C:\MSOffice, and IE in C:\Windows.

      And how about that name, "Program Files"? Could we get a little more ambiguous please? Very little of the contents of a computer hard drive is not "a file for a program". However, the situation has improved since that directory's introduction in Windows95. Before Microsoft created the separate "C:\My Documents" directory, all programs saved by default to "C:\Program Files\Vendorname", which made a lot of sense.

    15. Re:POSIX,LSB,BSD,heck, where is everything? by wfberg · · Score: 1

      Oh, and you shouldn't use %windir% except in shell scripting, there's an API call to get the Windows directory. (Also home directory, temp directory, etc).

      As well as in oemsetup.inf files (though that makes windows use the API call, which may or may not be the same value).

      --
      SCO employee? Check out the bounty
    16. Re:POSIX,LSB,BSD,heck, where is everything? by Anonymous Coward · · Score: 0

      That about sums it up, doesn't it? Of course, if you've installed the Resource Kit, you've got another location, but not to belabor the point ...

      If anyone is interested and/or suffers from an over-long path statement as a result of this mess, creating a shortcut for each executable and dumping them all somewhere convenient like c:\bin to facilitate starting each via the Run dialog box (or similar method) can provide a workaround, and is cleaner than the alternative method of adding each into a separate registry entry.

      Just a thought.

    17. Re:POSIX,LSB,BSD,heck, where is everything? by Anonymous Coward · · Score: 0

      > So where should the data files for all applications live? There's not really a good place for them. /var/appname, such as in /var/named as you pointed out.

      "var" doesn't literally mean "MUST be variable", it means "can be variable". It's the place where changeable data-specific things go. Easy one-step data backup: /var/*.

    18. Re:POSIX,LSB,BSD,heck, where is everything? by Sique · · Score: 1

      That's what I call "the wrong way around". You should have it really stored at the same place on every installation. But to the user you should have a localisation layer, that translates "Program Files" to whatever her locale wants to have. So no program has ever to take care where to store its files, and the localisation layer transforms it to whatever the local user wants.

      --
      .sig: Sique *sigh*
    19. Re:POSIX,LSB,BSD,heck, where is everything? by jandrese · · Score: 1

      Oh man, C:\Program Files\ is the bane of my existance sometimes. Have you ever had to write a bunch of batch files to do things in a post 95 Windows? Have you ever been driven insane by the way applications define their own quoting rules (if any), and because M$ threw spaces in all of the important directory names, you have to learn _all_ of them. This problem extends beyond batch files, even drag on drop stuff has problems if you don't get the quotes just right on the .pif file. Even when you get it working for some applications, there are always a few (Snort IDS for instance) that seem to screw it up anyway. Before Win95, this wasn't a problem because nobody put spaces in the names, but now everything is a mess. I'm still convinced that M$ did that to aggrivate the command line users into using the gui.

      --

      I read the internet for the articles.
    20. Re:POSIX,LSB,BSD,heck, where is everything? by lokedhs · · Score: 1
      Yeah... Right...

      On my XP parition can can find: c:\Program (swedish version).

      My administrator account (and hence also it's home directory) is located in c:\Documents and Settings\Administratör (yes, that's an "ö").

      I have a background image called c:\WINDOWS\Solfjädrar.bmp (Sunfeathers.bmp in the english version?)

      Oh, by the way. I also have a directory c:\Program Files\ because some (reasonable?) programmers believed that Microsoft weren't so stupid as to localise system files.

    21. Re:POSIX,LSB,BSD,heck, where is everything? by johannesg · · Score: 1
      Granted, the *nix way of doing things isn't perfect, but at least it had homedirectories(!) with .apprc settings ages ago.

      Yeah, like we really needed thousands of .whateverc files in our home directory. Not to mention countless environment variables, sometimes unpleasantly clashing with each other.

      I like to keep things *clean*. I don't want endless weird-named files in my ~/, not even if ls conveniently hides them. Why isn't this in ~/etc/? I know - hysterical raisins, of course, but surely it isn't too late to change is it?

      And the same thing goes for environment variables. Especially those with short, common names - if your application needs configuration, for heavens sake use a configuration file. And put it in ~/etc/ while you are at it...

    22. Re:POSIX,LSB,BSD,heck, where is everything? by thogard · · Score: 1

      I keep dns stuff in /var/named too but I've not quite found a good place for apache. For a virtual host, the a homepage would be /home/hosting/www.example.com/htdocs/index.html.

      I sort of look at /home as the new "/usr" (home directories used to be in /usr/userid). There are a few discussion of what "usr" stands for but I've got some very old AT&T references that claim it "user" spelled the unix way. Others claim its "unix system resources" but I don't buy that. In the old days, ls lived in /bin/ls, cc lived in /usr/bin/cc because it was often rebuilt and /usr/bin/ was often g+w or o+w.

      In general you want stuff in partitions to change at the same rate, /var gets log files so they change every minute, /usr/bin /usr/lib should change only after an upgrade, /etc should change rarely but more than /usr/bin/

    23. Re:POSIX,LSB,BSD,heck, where is everything? by wfberg · · Score: 1


      Yeah, like we really needed thousands of .whateverc files in our home directory. Not to mention countless environment variables, sometimes unpleasantly clashing with each other.


      In fact the one thing windows DID have going for it were .ini files. Easily edited, standard format, human readable with room for comments. And the settings in the "working directory" the app started up from would override settings in c:\windows\app.ini. Much better than that registry malarky.

      --
      SCO employee? Check out the bounty
    24. Re:POSIX,LSB,BSD,heck, where is everything? by Bob+Uhl · · Score: 1
      So where should the data files for all applications live? There's not really a good place for them.

      /usr/share or /usr/local/share? Although to be honest, /var probably makes the most sense, as it's also where print spools, mail files and the rest end up. share is more for little-changing non-configuration application data (e.g. logos); web pages change fairly frequently.

    25. Re:POSIX,LSB,BSD,heck, where is everything? by Anonymous Coward · · Score: 0

      Ok, windows is a mess, but you are exaggerating.

      explorer.exe is, and always has been, part of the operating system, thus it would never be under c:\progra~1. While most os executables are in %windir%\system32, the shell is traditionally in %windir%, so I would expect to find explorer.exe in c:\winnt

      iexplore.exe was originally a separate app, so it's probably under c:\progra~1\microsoft internet explorer or something. It's crap anyway, so who cares.

      Where's the uninstaller for FooSoft Bar?

      Its location will be in HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/Uni nstall/FooSoft Bar/UninstallString, unless you installed it as a restricted user, in which case it will be under HKCU. (btw, where the uninstaller for samba on my server? ;)

      Settings need to be in different places depending on what sort of settings they are. Large per-user things, like caches, should be under C:\Docume~1\user\application data. Small per-user things should be in the registry under HKCU. HKLM should be avoided, because you need priveledged access to write to it, but small machine-wide settings go there. (and you want those restricted anyway) ini files are out of date, and you can map them to the registry anyway.

      When is %windir% C:\windows and when is it c:\winnt?

      When you install windows in C:\Windows vs C:\winnt. If you install windows to C:\FishTank, that's what %windir% will be. Usually NT installs in C:\winnt by default. (what a surprise!)

      All this is complex for two reasons: Microsoft hasn't figured out the best way to do things yet (despite discovering it every other month), and complex situations require complex solutions.

      Windows paths are a great big piling heap of...

      backslashes. That alone is bad enough.

    26. Re:POSIX,LSB,BSD,heck, where is everything? by zenyu · · Score: 1

      That's what I call "the wrong way around". You should have it really stored at the same place on every installation. But to the user you should have a localisation layer, that translates "Program Files" to whatever her locale wants to have. So no program has ever to take care where to store its files, and the localisation layer transforms it to whatever the local user wants.

      The "Program Files" directory is specified in the registry. Installers should be looking this up in the registry and not using the path on their particular install. Mine was "C:\usr\local\bin" when I ran windows... If you use the Install Shield I'm pretty sure it does the right thing. Using it as a hard coded path is no better than those VB scripters who paint parts of their UI "windows gray" only to have it look like crap for anyone with a slightly different color scheme.

      Not that I don't agree everything should be in a standard location with symlinks for the happy fuzzy names. Unfortunately I think we have to wait for NT6.0 before there will true be symlinks on the Windows file system. I never understood why it's taken them so long, even MS-DOS 2.0 could have had hard links without much trouble.

    27. Re:POSIX,LSB,BSD,heck, where is everything? by johnnyb · · Score: 1

      I use /opt/webhosting/

      since the actual web sites are different than the Apache program. I consider a website to be a "package" which changes often.

      I have /opt/webhosting/conf for config data /opt/webhosting/sites/xxx.yy.zzz/htdocs is where each site goes.

      I don't know if the FHS would agree with me, but perhaps /var/webhosting instead?

    28. Re:POSIX,LSB,BSD,heck, where is everything? by Arandir · · Score: 1

      Why isn't this in ~/etc/?

      Actually, that's a damn good idea. I would have my apps put their .rc's there, except that I would be the only one doing so.

      But the raisins aren't hysterical. The reason is that it is up the individual application, and not the OS, to decide where the user configuration files go. It's nothing a distro can mandate.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    29. Re:POSIX,LSB,BSD,heck, where is everything? by Anonymous Coward · · Score: 0

      I want apache to be in the same place on every damn distro.... is it really that difficult to not screw with an install of a app?

      Meet my friend, ln.

      ln -s /path/to/apache /my/anal/apache/path

  14. Oh yeah? POSIX can be DUMB! by cculianu · · Score: 4, Informative
    106 2.1.4 gets 107 The LSB has deprecated the gets() function, whereas it is a first 108 class function in ISO/IEC 9945 and ISO/IEC 9899.
    How about the gets() function??! This is a dumb function. A first class function!! It is the stupidest function ever and GUARANTEES buffer overflow errors!!!
    1. Re:Oh yeah? POSIX can be DUMB! by Anonymous Coward · · Score: 4, Informative

      http://www.opengroup.org/onlinepubs/007904975/toc. htm :

      "Since the user cannot specify the length of the buffer passed to gets(), use of this function is discouraged. The length of the string read is unlimited. It is possible to overflow this buffer in such a way as to cause applications to fail, or possible system security violations."

    2. Re:Oh yeah? POSIX can be DUMB! by __past__ · · Score: 5, Insightful
      Doesn't matter a bit. If anything, issue a warning if someone uses a potentially dangerous function (like FreeBSD does for stuff like mktemp, the linker will print "Warning: Potentially unsafe use of mktemp, consider using mkstemp instead" or some such), but don't break apps that adhere to the standard. It has "portable" in its name for a reason.

      Even the bash approach where you have to explicitly ask for POSIX-conforming behaviour is better than nothing, even if I think that it should be the default.

      There are only two sane ways to deal with POSIX brain-damage: Fix POSIX, or don't use that stuff in your programs. OSes that are "mostly" POSIX-compatible are worse for portability that those who just say that they don't implement POSIX at all.

    3. Re:Oh yeah? POSIX can be DUMB! by cculianu · · Score: 4, Informative

      Well, if I am not mistaken in the current Gcc/Glibc combo you can turn on dumb things like gets() and mktemp() anyway.. but their being off by default makes most programs safer and a minority of programs require special platform-specific build flags...

    4. Re:Oh yeah? POSIX can be DUMB! by Anonymous Coward · · Score: 5, Insightful

      Errr, no, we need to actually eliminate these functions that are unsafe by design, and if a program uses gets(), then too bad, it needs rewritten by an actual programmer and it can't be ported until it is rewritten.

      This is on the same scale as your mother asking, "If all your friends jumped off a bridge, would you jump."

      Them even bringing up gets() makes me doubt their whole report. If the rest of their comments are on the same scale as this, I'd say go with the LSB everytime.

      The LSB overrides and superceeds all previous standards with a single common way of doing things that actually halfway makes sense.

    5. Re:Oh yeah? POSIX can be DUMB! by natmsincome.com · · Score: 4, Insightful

      Both of your solutions don't work. You can't fix POSIX. It takes years to add stuff to a standard (that's why it a standard) Even if you were able to add it you end up with stuff like sql where all the big SQL database support sql 92 but none support sql 97(I might have go the dates wrong). Noone supports the latest sql so there's no point learning it since everyone supports different parts of it. One of the main reason why the LSB was formed was that adding stuff to POSIX takes to long and they wanted to define stuff that's outside of the scrope of POSIX.

      The second comment it also wrong. If you have systems that are 90% POSIX compatable it much easier to port software to it than if it's 0% POSIX compatable. In the end you have a lot of #ifdef in you code or in the portable classes. The less #ifdef you have to do the easier it is. It does make it harder to debug though as you have to know the subtle differances.

      Most of the time though you use a library that wrapes it all up for you like wxWindows or POSIX that makes it fairly portable. You just have to alway remember that different OS have different levels of completeness.

    6. Re:Oh yeah? POSIX can be DUMB! by Anonymous Coward · · Score: 0, Troll

      There are many uses for gets(), and I'm surprised you
      can't imagine how it can be used safely. In fact it can,
      if you stop and think about the problem for a bit.

      But there's also the issue of legacy apps that need gets().
      Don't give me this "it needs to be rewritten" stuff. What
      if someone wanted to run these apps on their own
      computer, disconnected to the net, in a bomb proof bunker
      in the middle of the Antarctic, giving only VALID INPUTS
      to gets(). Would it not be THEIR CHOICE and not
      LSB's silly, knee-jerk reaction against gets()?

      A better question is why, oh why, did LSB decide to kill
      the messenger (that is, gets()), instead of fixing the
      original problem (W^X pages lacking in kernel, no exec
      stack emmu on x86).

    7. Re:Oh yeah? POSIX can be DUMB! by LilMikey · · Score: 1

      Usage of these functions is already too widespread. For the analogy to be correct, it would be like you're mother asing you that when you're already 1/2 way down. You need a parachute to soften the fall 'cause you jumped a long time ago.

      --
      LilMikey.com... I'll stop doing it when you sto
    8. Re:Oh yeah? POSIX can be DUMB! by Creepy · · Score: 1

      gets is bad for other reasons - some OSes have even deprecated it, but leave it in for POSIX compatibility/compliance.

      If you don't know why gets is bad, the MacOS X man page has this, under BUGS:
      Since it is usually impossible to ensure that the next input line is less
      than some arbitrary length, and because overflowing the input buffer is
      almost invariably a security violation, programs should NEVER use gets().
      The gets() function exists purely to conform to ISO/IEC 9899:1990
      (``ISO C89'').

      Truth be told, almost all of the issues could be coded around using other, better functions, so I fail to see why deprecating a few is a big deal. If you leave the functions available and just say not to use them (pretty much the point of deprecating), older code will be able to run in the short term (or even the long term, depending if it is ever pulled out) and new code is written without using the problematic method.

    9. Re:Oh yeah? POSIX can be DUMB! by einhverfr · · Score: 1

      Usage of these functions is already too widespread. For the analogy to be correct, it would be like you're mother asing you that when you're already 1/2 way down. You need a parachute to soften the fall 'cause you jumped a long time ago.

      Hence the function is depricated but available with special compiler flags. That is the parachute ;-)

      --

      LedgerSMB: Open source Accounting/ERP
    10. Re:Oh yeah? POSIX can be DUMB! by Anonymous Coward · · Score: 0

      It's a little bit like my opposition to mandatory
      government health warnings on greasy hamburgers.
      Of course they're bad for you, but it's your choice
      to eat them or not. Do you really need a mandatory
      gov't warning?

      Likewise, gets() can be used safely and unsafely. People
      need to learn how to use it safely for those applications
      where it can be used (and it CAN be used safely, if you
      stop and think about it.) Do we really need a warning
      message every time we use it?

      Moreover, how does this warning message come up?
      Well, through non-iso compliant C code, that's how.
      They use #warning to issue a message about gets usage.
      #warning is not valid ANSI/ISO-C. It's a GNU
      extension to the language (just like so many other
      MS-inspired extensions to the language).

      LEAVE IT ALONE. Let people use gets if they
      want. Let them shoot themselves in the foot
      a few times. Face it: people who SELL software
      that other people actually buy know enough not
      to use gets, or (better yet) know how it can be
      used safely.

      We don't need your paternalistic advice about how
      to program. It's obnoxious, and troubling since
      only gets(), and not the other 1,000,000 bad
      programming mistakes are flagged.

    11. Re:Oh yeah? POSIX can be DUMB! by einhverfr · · Score: 1

      It takes years to add stuff to a standard (that's why it a standard) Even if you were able to add it you end up with stuff like sql where all the big SQL database support sql 92 but none support sql 97(I might have go the dates wrong).

      Actuatlly it is SQL 99.

      The real problem is that it takes years for things to be added to standards, and years more for those standards to be implimented in most settings. So although PostgreSQL is nearly ANSI SQL 99 complient (core requirements), it is still being worked on by Oracle, Microsoft, Sybase, etc.

      If you check the PostgreSQL 7.4 developer docs, and you exclude the bit about embedded Fortran, etc. (yes, standards have a lot of legacy support as well), you will find that there are only 19 unsupported core features in PostgreSQL 7.4. Compare that to the 155 supported core features, and we can see how far SQL 99 is actually coming.

      So too with Posix. However, gets() IMO should not be a first-rate function. Just as embedded Fortran should not be a requirement for SQL 99 conformance.... I know one has to be sensitive w.r.t. backwards compatibility, but there is a point where they should say "Optional Legacy Support."

      However, having read the article, I think that parts of it are childish (the gets() thing) and other parts of it do highlight a challenge-- that Linux is still struggling with things like pthreads, and that this will continue to be an issue for a little while.

      --

      LedgerSMB: Open source Accounting/ERP
    12. Re:Oh yeah? POSIX can be DUMB! by jeremyp · · Score: 1

      Likewise, gets() can be used safely

      I fail to see how. gets uses stdin for its input stream. There's no way the programmer can control what comes in on that without closing stdin and reopening to a file with known and trusted contents (in which case why not use fgets directly?). I could pipe anything I like to stdin so there is absolutely no way for the programmer to prevent a buffer overflow.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    13. Re:Oh yeah? POSIX can be DUMB! by StormReaver · · Score: 1

      "Errr, no, we need to actually eliminate these functions that are unsafe by design, and if a program uses gets(), then too bad, it needs rewritten by an actual programmer and it can't be ported until it is rewritten."

      Linux is not in the position to dictate terms to anyone, but it is now in a position where people depend upon it to run their old apps. There are too many alternatives to which people can turn if Linux system developers get too snooty.

      Encouraging people to use the correct alternative, but leaving the entrenched and unsafe standard in place for compatibility, is a must. You cannot expect people, who are already hard pressed to meet deadlines, to go back and change thousands of occurances of gets() to fgets() (or something else) on a whim just because some glibc developer got onto his high horse. Such changes invariably cause unintended consequences, some of which may cost your employer hundreds of thousands of dollars in completely wasted time.

      gets(), dangerous as it is, cannot just be yanked out from under the millions of lines of product code that it supports.

    14. Re:Oh yeah? POSIX can be DUMB! by lokedhs · · Score: 1
      Them even bringing up gets() makes me doubt their whole report. If the rest of their comments are on the same scale as this, I'd say go with the LSB everytime.
      Well, the report set out to highlight the differences between LSB and POSIX. That's exactly what they did. Why do you doubt it?
    15. Re:Oh yeah? POSIX can be DUMB! by that+_evil+_gleek · · Score: 1

      Err No, because if it is removed then this will become common:
      #define gets(s) (fgets(s,MAX_INT,stdin))

      And slop on #include if its not already there

      And btw, this kind of protect the programmer from himself is what leads to Pascal, Java, etc. If you really feel strongly about it, what about just righting a small .so lib that imps fgets to abort with core dump, then set LD_PRELOAD...
      Personally, I don't use gets, but If I see the linking warning on a small prog that I know doesn't run as root, doesnt provide any services, isn't any kind of server, won't be called by any server, can be reasonably certain won't be set up to run inside restricted shell environment then I shrug it off --I've been warned at any rate.
      The real issue is when servers are written in quick and dirty 'app' style, but, since the same quick and dirty programmers would just imp the above, its not really a solution, in fact it's worse, because I wouldn't even get the warning.

    16. Re:Oh yeah? POSIX can be DUMB! by kasperd · · Score: 1
      Likewise, gets() can be used safely
      I fail to see how. gets uses stdin for its input stream.

      There are at least two safe ways to use gets()
      • Read from a source where you know an upper limit on the length of a line.
      • Read into a fenced buffer, such that you can handle long lines with a signal handler, or just dump core safely.
      --

      Do you care about the security of your wireless mouse?
    17. Re:Oh yeah? POSIX can be DUMB! by kasperd · · Score: 1

      It takes years to add stuff to a standard

      Some of the changes might actually be about removing stuff from the standard.

      --

      Do you care about the security of your wireless mouse?
    18. Re:Oh yeah? POSIX can be DUMB! by Anonymous Coward · · Score: 0

      I thought they are not off by default. I thought they just print a warning.

      It's been awhile since I've compiled anything with gets() so I could be wrong.

    19. Re:Oh yeah? POSIX can be DUMB! by John+Harrison · · Score: 1
      Are you saying that the fact that it is available is the parachute or that you have to use special compiler flags is the parachute?

      There is no parachute here. The special flags are a gate at the edge of the cliff with a sign that says, "If you jump off this cliff, you're likely to get hurt or killed."

    20. Re:Oh yeah? POSIX can be DUMB! by Anonymous Coward · · Score: 0

      Read from a source where you know an upper limit on the length of a line.

      Very rare. Unless you're reading from a pipe to a known secure process, the input stream is potentially coming from something malicious.

      Read into a fenced buffer, such that you can handle long lines with a signal handler, or just dump core safely.

      Ok... So why would you not use fgets in this case? Just because you like doing things the hard way?

      gets is useless. New code should never use it.

    21. Re:Oh yeah? POSIX can be DUMB! by johnnyb · · Score: 1

      "gets(), dangerous as it is, cannot just be yanked out from under the millions of lines of product code that it supports."

      I don't think it's as bad as you say. If you are actually using gets() in production, you deserve to have the LSB guys take up your time fixing it. It's not for the vendors, it's for the user's of vendor's software.

    22. Re:Oh yeah? POSIX can be DUMB! by Anonymous Coward · · Score: 0

      Very rare. Unless you're reading from a pipe to a known secure process, the input stream is potentially coming from something malicious.

      So, because you don't think it will be used often, this venerable old function, used in countless old apps that can be wrapped in safe handlers, should not be used?

      It should NOT be deprecated. If you want to start deprecating things merely because they might be used unsafely, then deprecate all of C fer chrissake. Pointer arithmetic should be deprecated. Static-sized buffers deprecated. mmap should be deprecated. Anything that people might use irresponsibly should be deprecated.

      If "very rarely" is your test, then get rid of mmap. Fewer people use it than (safe) uses of gets.

      You linux kids just don't get it, do you? It's about choice

    23. Re:Oh yeah? POSIX can be DUMB! by kasperd · · Score: 1

      So why would you not use fgets in this case?
      Because then I will not get a signal in case of long lines.

      Just because you like doing things the hard way?
      Nope, using fgets is the hard way. Setting up a safe buffer and using gets requires less programming if you do it often.

      --

      Do you care about the security of your wireless mouse?
    24. Re:Oh yeah? POSIX can be DUMB! by Anonymous Coward · · Score: 0

      The deprecation is the parachute. The compiler flags are a knife so you can saw through the parachute cables and plummet to your doom.

    25. Re:Oh yeah? POSIX can be DUMB! by Anonymous Coward · · Score: 0

      Wow, what a marathon troll-fest.

      Anyway, for the benefit of the non-braindamaged /.ers who might be paying attention to this, you're not guaranteed a signal in case of long lines. You'll *usually* get a SIGSEGV if you overwrite your return address on the stack, or overwrite the end of your heap, but consider the cases where you'll just be trashing other variables and buffers in your program.

    26. Re:Oh yeah? POSIX can be DUMB! by Anonymous Coward · · Score: 0

      They did say a "fenced buffer", so presumably the buffer is immediately followed by an unmapped page that raises SIGSEGV. This, of course, is absurdly expensive compared to checking the return value, but it does work (if you never ever want to run on any machine without virtual memory).

    27. Re:Oh yeah? POSIX can be DUMB! by Anonymous Coward · · Score: 0

      This is on the same scale as your mother asking, "If all your friends jumped off a bridge, would you jump."

      Bungee jumping makes a complete mockery of this little piece of "Mom wisdom".

    28. Re:Oh yeah? POSIX can be DUMB! by kasperd · · Score: 1

      They did say a "fenced buffer", so presumably the buffer is immediately followed by an unmapped page that raises SIGSEGV.
      An unmapped page would not be safe since it could later get allocated from a different place in the program. An allocated but write protected page works. And that will give you a SIGSEGV.

      This, of course, is absurdly expensive compared to checking the return value
      It is expensive in case of a long line. But it is cheaper in all the cases where the line is not too long. Sometimes programmers are willing to accept a huge penalty in the rare cases to get a minor improvement in the usual cases, because on average the code will be faster.

      if you never ever want to run on any machine without virtual memory
      Without virtual memory local security is nonexistent. So I certainly don't want anything running without virtual memory.

      --

      Do you care about the security of your wireless mouse?
    29. Re:Oh yeah? POSIX can be DUMB! by mirabilos · · Score: 1

      The problem with the BSD in-tree warnings is that the
      programmes have been fixed (even strcpy and sprintf
      are warned now), but the GNU stuff in the tree not.

      root@n1:/usr/src/gnu/gcc/libiberty # grep sprintf * | wc -l
      77

      And it's not a fun task to fix crappy GNU code.
      (It's not fun to fix AT&T-stylish written 4.4BSD
      nroff/neqn and friends either...)

      --
      My Karma isn't excellent, damn it! (And /. still does not get UTF-8 right in 2012. Wow.)
  15. Re:screw POSIX by Rosco+P.+Coltrane · · Score: 2, Interesting

    In other news:

    Acme, Inc. has announced that they won't be porting their leading product, Foocreator-4.5, to the Linux platform, CEO John Doe announced today. "The incompatibilities between Unix and Linux are minor, but significant enough that we'd have to review our entire codebase. There may not be a large enough Linux market to justify this effort." he declared today.

    --
    "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
  16. Linux must improve POSIX conformance by Anonymous Coward · · Score: 5, Interesting
    Especially in the pthreads area.

    I do a lot of really high-performance multi-threaded programming, and the Linux threads model pretty much eliminates it from competing in that arena - and believe me, I'd love to be able to underbid any competition by constructing a Linux cluster of commodity pizza boxes.

    There's no way doing a popen() or system() should hang a multithreaded process.

    If IBM is really going to make Linux work on this sort of enterprise level, maybe they should make Linus an job offer with one crooked number followed by a blank and tell Linus: "Fill in as many zeros as you think is correct".

    1. Re:Linux must improve POSIX conformance by multipartmixed · · Score: 1

      I agree, popen() or system() shouldn't hang the system. That said, under under certain real unices, they aren't marked thread-safe (Solaris 8, for instance). I'm pretty sure that's corrected under Solaris 9, but I haven't checked.

      A reasonable approach might be to use the Apache Runtime for those functions; apr_proc_create(?) combines the ability to do popen/p2open/system into one call which they claim is thread safe, and seems to be from my own experimentation. Well, that, and the fact that they are used for CGIs under Apache 2.x, which seems to be pretty stable.

      apr_proc_create is implemented with fork() and xec(), which are marked async-signal-safe under Solaris 8.

      --

      Do daemons dream of electric sleep()?
    2. Re:Linux must improve POSIX conformance by Anonymous Coward · · Score: 0
      popen() and system() were just the most egregious examples that came to mind - yeah, I know they're MT-unsafe in Solaris 8 but I could still use them if I keep that in mind.

      Another difficulty is that Linux threads behave differently than POSIX threads - which isn't a surprise given Linux uses cloned processes and most Unices use lwps. When you're trying to do things like parallel high-speed IO using multiple threads the manner the threads interact becomes important. Code that screams on Solaris can be a dog on Linux.

      In my experience Linux threads are a lot less reliable and predicable than Solaris or Irix threads when you start trying to push them hard. That's not surprising given that Linux hasn't been around as long, nor supported by companies that intend to sell it as the prime OS for servers with lots and lots of CPUs. But since the environment I work in does involve servers with lots of CPUs and multithreaded processes, I see the need for improving Linux threading more than most.

    3. Re:Linux must improve POSIX conformance by Arandir · · Score: 1

      You might want to try constructing a FreeBSD cluster of commodity pizza boxes instead...

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    4. Re:Linux must improve POSIX conformance by kindbud · · Score: 1

      There's no way doing a popen() or system() should hang a multithreaded process.

      Hahaha! You kill me. Why not just write a shell script? <snicker>

      --
      Edith Keeler Must Die
  17. Why LSB? by Anonymous Coward · · Score: 0, Insightful

    Obviously I'd say that POSIX is in the right; it's an older, wider standard. But as for the LSB... why do we even need it? A single totalitarian ruleset like this is against the spirit of open source; the progress we have from the competition of projects like KDE and Gnome show this.
    I'm not trying to start a flamewar, but if we carry on dogmatically sticking to the LSB (and incidentally make everyone like Redhat; god only knows why RPM was chosen over .deb or portage) we're just going to find ourselves ending up with a single system with no choice, no better than M$ Windoze.

    1. Re:Why LSB? by RdsArts · · Score: 1

      we're just going to find ourselves ending up with a single system with no choice

      Until the *BSD FTP sites come back online after their bi-yearly maintance.

      (it's a joke. Laugh. I mean, seriously, like they'd need to be taken down that often.)

  18. Everything Else by rf0 · · Score: 1, Insightful

    Everything else is going toward POSIX compliance, even NT4 can be made POSIX compliance so why go the other way? Just to be different?

    Rus

    1. Re:Everything Else by afidel · · Score: 3, Insightful

      Looking through the list in the few instances where there is a real world impacting difference the change was made for reasons of sane implementation. Like the difference in kill, Linus tried it the POSIX way and people were not at all happy. Same thing with gets, it makes sense to make something that leads to so many bugs deprecated. There are some real issues there to be fair but I think Linux is about as POSIX compliant as anything. MS's NT4 POSIX subsystem sucks and is only compliant to an ancient version of POSIX. It was tacked on when the government required POSIX compliance for most contracts.

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    2. Re:Everything Else by sqlrob · · Score: 3, Informative

      Everything is going toward POSIX compliance?

      XP and Win Server 2003 aren't compliant.The POSIX subsytem was removed in XP and everything after.

    3. Re:Everything Else by Diomidis+Spinellis · · Score: 5, Informative
      The POSIX compliance of Windows NT is a farce. It was only added as a marketing trick allowing Windows-based systems to compete in procurement contracts where POSIX compatibility is an obligatory specification. As implemented in Windows NT and Windows 2000 the POSIX subsystem is almost useless. According to Microsoft's documentation applications running in the POSIX subsystem applications have no direct access to any of the facilities and features of the Win32 subsystem, such as memory-mapped files, networking, graphics, or dynamic data exchange. Applications working in the POSIX subsystem essentially operate in an isolated text terminal island. The original POSIX subsystem was probably an embarrassment to Microsoft, so it was quietly dropped when moving to Windows XP and beyond in favour of the Interix technology.

      If you want POSIX compatibility under Windows you are better of using Cygwin or - at the shell level - the native ports of GNU utilities to Win32. Add to the mix my Outwit tools for Windows interoperability and you are set.

      Diomidis Spinellis - Code Reading: The Open Source Perspective
      #include "/dev/tty"

  19. Well by Anonymous Coward · · Score: 2, Funny

    It seems that Posix has some updating to do.

  20. WRONG! POSIX does some really dumb things!! by cculianu · · Score: 5, Informative

    POSIX does some dumb things. Ever hear of the gets() function?

    Also, in most cases the LSB is a superset of POSIX, but the contradictions are _minor_. Not show-stoppers.. not enough to require significant application rewrites when porting to Linux. So what if O_LARGEFILE is set most of the time? This is actually a good thing because most of the time it causes no problems. Even if you are checking the fd flags O_LARGEFILE being set isn't a problem as long as you check the flags in the _right_ way, that is logical AND'ing them with the flag you want to check for. The only time this contradiction causes a problem is if you are breing stupid and expecting the flags to be explicitly equal to some magic number you were expecting. Sure that is not exactly to spec, but for 99.9% of the apps out there it doesn't break compatibility, and if it does it's a one-line fix. However the benefint of fcntl() acting this way is clear -- most apps on linux have no problems with 64-bit file-sizes which are more and more common these days!

  21. It's not even a matter of checking user input! by cculianu · · Score: 4, Informative
    No programmer in their right mind uses the I/O POSIX functions without checking the user input. Too bad there are still very common buffer overflows, format strings and heap overflows found in (more or less major) projects.

    Dude, gets() is so bad, there is _no way_ to guarantee that the incoming string isn't going to totally cause a buffer overflow! _No way_! You can ioctl() with FIONREAD all you want, you still aren't guaranteed that the string you pass to gets() is actually big enough to hold the incoming text. At best you get a program crash -- at worst you get a hacker with root!

    gets() is just bad, horrible, terrible design. You say something about checking the input to prevent overflows, but by the time you get the string back from gets() it's too late! The stack is already fsked. Or if it's on the heap you probably already crashed or your program is somehow otherwise corrupt...

    1. Re:It's not even a matter of checking user input! by Gorny · · Score: 1

      You're right. I was talking about all functions in general and didn't talked about gets() specifically.

      --
      Alan Perlis once said: "A language that doesn't affect the way you think about programming, is not worth knowing"
    2. Re:It's not even a matter of checking user input! by EvilTwinSkippy · · Score: 1

      Can I invoke stupidity and ask exactly who is being sarcastic?

      --
      "Learning is not compulsory... neither is survival."
      --Dr.W.Edwards Deming
    3. Re:It's not even a matter of checking user input! by cpeterso · · Score: 1


      Historically, I wonder who first spec'd and wrote gets(). The offending author should step forward from the annals of history and take an embarrassed bow. Was it Dennis Ritchie? What was it?

      This Usenet post from 1992 says Dennis Ritche wrote the stdio library, but gets() is part of the STRING library written by someone else.

      http://groups.google.com/groups?selm=1992Jun27.193 203.3370%40eskimo.celestial.com&rnum=6

    4. Re:It's not even a matter of checking user input! by Ben+Hutchings · · Score: 1

      No, the article says gets() is not part of the string library (in which some functions have length-limited variants). gets() is not mentioned in K&R first edition (1978), whereas fgets() is. I would be inclined to blame Berkeley for the fuzzy thinking that must be behind gets().

    5. Re:It's not even a matter of checking user input! by Ben+Hutchings · · Score: 1

      I searched for and eventually found some relevant history. It turns out that gets() was part of the "portable C library" written by Mike Lesk and released with version 6 of Unix. fgets() is part of stdio, which was written by Dennis Ritchie and released with version 7. Most of the "portable C library" seems to have been changed or discarded, but gets() lives on.

  22. Re:POSIX LSB by leandrod · · Score: 4, Informative
    > it's better for GNU/Linux (never know if rms is watching ;) to comply to the older POSIX

    Funny thing you mention them in the same breath, since RMS was behing the original /usr/group that gave birth to POSIX.

    Given that his world view isn't Linux-centric, I guess he'd be behind POSIX even today, as compliance would make eventual port to the Hurd easier in some measure; OTOH, many of the LSB extensions are actually the officialisation of GNU extensions in glibc and other GNU tools, so they don't hurt so much these days that software get ported from GNU to proprietary Unix instead of the other way round.

    All things considered, standards should go together; extensions aren't bad if they bring benefits and are easily flaggable, but simple violations are evil if they can just creep in without bringing benefits nor being easily spotted.

    --
    Leandro Guimarães Faria Corcete DUTRA
    DA, DBA, SysAdmin, Data Modeller
    GNU Project, Debian GNU/Lin
  23. So many websites, so little time by 192939495969798999 · · Score: 2, Interesting

    It is always amazing to me that Linux is able to evolve, despite the fact that there are a million different websites that all have various linux-based information on them, and a million people all working on it in different places. Linux is almost evolving like a life form, versus a Microsoft piece of software which evolves more like a battle plan -- all wrapped up in one office under one company.

    --
    stuff |
    1. Re:So many websites, so little time by EvilTwinSkippy · · Score: 1
      I would argue Linux evolves BECAUSE of the millions of different websites and a million poeple working on it in different places.

      Before we had historians, poeple did things. Before we had journalists, people communicated. Before we had critics, people made artwork and music.

      Never confuse progress with those that try to put the calipers of reason to it. Indeed, what is recognized as a trend doesn't really exist until everyone involved has died and someone picks through the scraps.

      --
      "Learning is not compulsory... neither is survival."
      --Dr.W.Edwards Deming
  24. Why does the Open Group care? by mabhatter654 · · Score: 4, Interesting
    What part of GNU's not Unix don't they understand? As well as the fact that Linux is not an "offical" unix either. Why do they care about what some "fringe" group does?

    Could it be that more people are writing apps for the "unoffical" version because it has more seats than all of the offical Unixes put together? Is everybody just going away from "Unix" and leaving them holding their useless rubber "Unix" stamper? Oops!

    1. Re: Why does the Open Group care? by Black+Parrot · · Score: 0, Funny


      > What part of GNU's not Unix don't they understand?

      Maybe they haven't finished expanding the acronym yet.

      --
      Sheesh, evil *and* a jerk. -- Jade
    2. Re: Why does the Open Group care? by EvilTwinSkippy · · Score: 2, Funny
      Yes, but the question is subtler. Does GNU mean:
      • GNU Not Unix! (Take that)
      • GNU Not Unix? (Say What?)
      • GNU Not Unix!? (Now you tell me.)
      • GNU Not Unix. (We came, we saw, we implemented.)

      (With apologies to the old "Dude" skit.)

      --
      "Learning is not compulsory... neither is survival."
      --Dr.W.Edwards Deming
    3. Re:Why does the Open Group care? by Anonymous Coward · · Score: 2, Insightful

      POSIX is not Unix. POSIX is a standard which describes a set of basic functions to aid portability which any Operating System can implement. Many non-UNIX Operating Systems implement POSIX, including WindowsNT, BeOS, Amiga OS etc. POSIX is diliberatly small in scope and does not enforce policy; all it defines is the most basic parts of the API. POSIX does not tell you how to lay out your filesystem, how to implement a network layer or even how your scheduler should work.

      The Open Group are probably putting this together because they are seeing problems with developers who are assuming that non-POSIX extensions from GNU and the LSB These developers write with these extensions and then run into problems on another POSIX system when these extensions do not work.

      This isn't just a problem for "old school" Unix vendors not being able to compile non-POSIX Linux source, but also a problem for other non-Linux OS which are trying to stick to the standards. Linux running away and doing its own thing doesn't help anyone, free software or otherwise.

    4. Re:Why does the Open Group care? by IM6100 · · Score: 1

      If there's no standard for what Linux is, then the 'more people writing apps for the "unofficial" version' are all writing apps for (somewhat) different OSes. Ever heard of the tower of Babel? Ever read the history of the fragmentation of UNIX in the 80's??

      --
      A Good Intro to NetBS
    5. Re:Why does the Open Group care? by Anonymous Coward · · Score: 0

      Actually, the Open Group cares because the Open Group wants to charge people money for certifying their OS as LSB compliant. The LSB will become POSIX++

    6. Re:Why does the Open Group care? by TheRaven64 · · Score: 1
      Why do they care about what some "fringe" group does?

      If Linux were the only OS that anyone used, then it would have to fork. One of the driving principles of the open source philosophy is strength through diversity. The way in which this strength is maintained is by standards. Linux conforms to standards, as do the *BSDs and Hurd. This allows you to take the source code from a program written on one system and compile and run it on another.

      Contrary to the beliefs of several fanatics, Linux is not the only OS, and neither is it the best OS for every task. Compatibility with standards is vital.

      --
      I am TheRaven on Soylent News
    7. Re:Why does the Open Group care? by jmorris42 · · Score: 1

      Why does Posix matter? The GNU tools are available on every major platform so apps compiled against them work anywhere. Just how much difference is there between a GNU environment hosted on Linux vs Win32 vs Solaris?

      That is the difference between a spec that lives on dead trees vs one that is defined by free portable source.

      --
      Democrat delenda est
  25. NPTL? by Styx · · Score: 4, Informative

    I'm no thread programmer, but I think that NPTL (The Native POSIX Thread Library for Linux) may solve your problem.

    --
    /Styx
  26. The source of evil by quantum+bit · · Score: 4, Informative
    Aha! So this is the source of all those Linux-isms that cause some apps to not run right on BSD and other Unicies. Open-source ones can be fixed but I believe that this:

    134 LSB permits as deprecated behavior, the return value of a successful
    135 call to nice() to be 0 (rather than the new nice value). A future version
    136 of the LSB is expected to require the new nice value, as specified in
    137 the ISO/IEC 9945. Until then, applications need to call the getpriority
    138 function, rather than rely on the return value from nice() on LSB systems.


    was the source of some of the headaches VMware has been giving people... (as the BSD implementation of nice(3) follows POSIX).

    Code writers: pay close attention to this page if you want to avoid being laughed at by the rest of the world...
    1. Re:The source of evil by cant_get_a_good_nick · · Score: 1

      What's the status of select()? In most UNIX implementations, the struct timeval that you pass in is const. In Linux, it is the amount of time left after the wait, including 0 if the select returned because time ran out. This caused me a little chasing around some time back. I'm not sure what POSIX says about that parameter though.

    2. Re:The source of evil by quantum+bit · · Score: 2, Informative

      Well, POSIX 1.g defines timeout as a const. I just checked the NetBSD and FreeBSD sources, and while they don't define it as a const, both implementations make a copy to use for their own purposes and don't modify the one that the user passes (though the man pages warn that other OSes do modify it so it shouldn't be depended on for portable programs). So making those POSIX-compliant would only take a simple change to the system header files.

      The man page for select on Solaris says that timeout will be modified, but it doesn't say exactly WHAT it's changing it to. I don't have a running Solaris machine right now so I can't test it to see what it does... So it seems to be the Sys-V-derived and work-alike (Linux) systems that treat timeout as non-const.

    3. Re:The source of evil by lokedhs · · Score: 1
      No, timeout is not a const in UNIX 03. This is what the standard says:
      Upon successful completion, the select() function may modify the object pointed to by the timeout argument.
      So apparently all implementations are conforming.
  27. offtopic: Who is "RMS"? by Anonymous Coward · · Score: 0

    just wondering . . . it seems i'm always behind on /. jargon.

    1. Re:offtopic: Who is "RMS"? by Anonymous Coward · · Score: 3, Informative

      RMS is "Richard Stallman", the man behind the GNU project. Undoubtably a very talented and gifted individual, he has unfortunately been perceived as something of a "crank" amongst many people involved in the open source world. He is notorious for his insistence that the Linux OS should be referred to as "GNU/Linux", giving proper credit to the GNU software required to do anything useful. However, many people see this as whining - after all, following that precedent would mean that the OS should be called

      GNU/X/Apache/GNOME/KDE/BSD/Linux

      etc. in order to "properly credit" all those parties involved.

      He also has a very big beard. See his webpage for more info on the man.

    2. Re:offtopic: Who is "RMS"? by sketerpot · · Score: 2, Interesting
      GNU/X/Apache/GNOME/KDE/BSD/Linux

      Not so! The GNU/Linux name signifies that GNU is running on top of the Linux kernel. But your long thing seems to say that, among other things, GNOME runs on top of KDE. GNOME is actually part of GNU, and I think a better way of referring to my system would be:

      (KDE/XFree86 & GNU & BSD/Linux) & (Apache/GNU & BSD/Linux). Note the parentheses and ampersands.

    3. Re:offtopic: Who is "RMS"? by johnnyb · · Score: 1

      Hmmm.... "X" didn't put together an operating system, neither did GNOME or KDE. BSD is the closest thing, but really the runtime of Linux is GNU. The whole thing would just be GNU, except that RMS wanted to give credit to Linus, without whom GNU/Linux would still be waiting on those HURD developers.

    4. Re:offtopic: Who is "RMS"? by Xtifr · · Score: 1

      following that precedent would mean that the OS should be called GNU/X/Apache/GNOME/KDE/BSD/Linux

      Really? I've got 5 linux boxes here, let's see how much sense that name makes:

      GNU: yup, GNU libraries and utilities are installed on all my boxes. They won't even boot without those. In fact, there's more GNU code installed than kernel code. I'll go for that one.

      X: No X on three machines. Doesn't make any sense to add X to the name.

      Apache: No Apache on any of 'em (I'm using boa for internal stuff, thinking of setting up aolserver for an outward-facing webserver).

      GNOME: No gnome installed anywhere.

      KDE: No KDE installed anywhere.

      BSD: Tiny amounts of BSD code are installed. Unlike the GNU code, though, this is tiny compared to the kernel. Could go either way.

      Sendmail: you left this one out, but no matter, I wouldn't run sendmail on a bet. It's not even a standard component on the system I use (exim is, sendmail is an "extra" optional package).

      So, GNU/Linux makes sense, GNU/BSD/Linux makes sense, but isn't quite as justifiable, and the rest of that junk you mentioned makes no sense whatsover.

      Well, anyway, I still call 'em "my Linux boxes", but at least I don't try to pretend that I'm morally superior by rejecting "GNU". I'm just lazy! :)

  28. Standards by mark_slashdot · · Score: 0, Funny

    "The nice thing about standards is that you have so many to choose from" -- Andrew S. Tanenbaum

  29. Re:screw POSIX by Anonymous Coward · · Score: 1, Interesting

    It's quite interesting how the parent got modded 'interesting'

  30. Re:How about making more Distros comply first. by BenjyD · · Score: 0, Flamebait

    Damn, Slashdot moderation is screwed up. Joke post gets -1, post by clueless person who doesn't get the joke gets 5. Next time I go to the zoo I'm going to check the monkey house for chimpanzees with mod access

  31. Re:POSIX LSB by Anonymous Coward · · Score: 4, Informative

    POSIX is a dead standard that hasn't moved ahead in 20 years. The LSB simply makes official the extensions and common way of doing things that has grown up in the years since POSIX stopped evolving.

    A standards document like this is not a holy book that everyone must use as a daily guide. Every aspect of a standard like this should be constantly under ruthless attack to do things better.

    When I was in the Army every unit I was in had a Standard Operating Procedures (SOP) book. This document formalized the way things were being done at the time. This made it easier to train new people, but if someone came up with a better, easier, faster way of doing things and could get it accepted, guess what? That's right, they updated the book. So various units would evolve slowly overtime to the best way of getting the job done.

    A document like POSIX or the LSB is actually merely a "best practices" book and should reflect the best practices of the times, not be some arbitrary thing that documents how things were done 20 years ago.

    Not to mention the fact that POSIX is silent on way too many very important things that govern an actual Unix or Linux distribution.

    If two Unix or Linux distributions meet POSIX this is no guarantee that they are compatible in any way shape or form. But if two distributions meet the LSB, then you are guaranteed a very high level of interoperablity between the two.

    And there are easy to use tools that actually test compliance to the LSB.

  32. My hello program. by Black+Parrot · · Score: 2, Funny


    > GNU has helpfully published a version of "Hello, World!" that uses autoconf

    Why make things so complicated!

    # Makefile for "Hello World" program.
    #
    hello:
    @echo "Hello, World!"
    --
    Sheesh, evil *and* a jerk. -- Jade
    1. Re:My hello program. by Anonymous Coward · · Score: 0

      It wouldn't be GNU if they didn't over complicate things with seven layers of indirection, fifty seven configurable options (At each level), nine different self-configuring compilation tools and five hundred lines of code to print "Hello World!" to the console.

      Your Make example also fails to implement the bizaro GNU coding style. You should try to fit some curly braces in there at odd places and use a mixture of spaces and tabs to indent all of your code.

  33. The Big Dog Makes The Rules by Anonymous Coward · · Score: 1, Insightful

    This guy has it backward. Linux is the standard for Unix. The OpenGroup should learn about the state of the world as it exists, and not fret over what is no longer. The OpenGroup has lost their prerogative. They are no longer in the game. Linux is the big dog; the rest of the also-rans are fleas along for the ride.

    1. Re:The Big Dog Makes The Rules by Anonymous Coward · · Score: 1, Interesting

      How the heck does this junk get marked insightful? Linux exists because people were able to run their UNIX software on Linux. Working against POSIX will only harm Linux adoption in industry, where people care about acronym compliance.

    2. Re:The Big Dog Makes The Rules by jeremyp · · Score: 1

      By that argument, Windows is the standard for desktop computing and Word is the standard for text documents. Microsoft is the big dog, Linux is an also ran along for the ride.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    3. Re:The Big Dog Makes The Rules by Anonymous Coward · · Score: 1, Informative

      This guy has it backward. Linux is the standard for Unix. The OpenGroup should learn about the state of the world as it exists, and not fret over what is no longer. The OpenGroup has lost their prerogative. They are no longer in the game. Linux is the big dog; the rest of the also-rans are fleas along for the ride.

      Here is last quarter's server market share:

      $4.3 billion - all (real) Unix
      $3.2 billion - all Windows
      $583 million - all Linux

      Linux is the flea, and will be for years, if not forever. It might not even be able to hold onto its current market share depending on the outcome of the SCO-IBM lawsuite.

      Any thoughts that you have about Linux setting the standard for Unix today are either wishful thinking or stem from being uninformed.

    4. Re:The Big Dog Makes The Rules by Anonymous Coward · · Score: 1, Insightful

      I don't think so.

      Other operating systems are doing things the way POSIX specifies, not the way Linux does them. I wouldn't exactly consider the combination of Solaris, AIX, IRIX, HP-UX, {Free,Net,Open}BSD etc insignificant, considering how widely deployed they are. Most places I know run (and support) several Unix variants, including but not limited to Linux.

      Of course almost all of these systems have idiosyncracies, so the reality is still that if you want to write portable Unix software, you have to know something about all of the platforms you want to support.

      POSIX has made things easier compared to how things used to be.

    5. Re:The Big Dog Makes The Rules by Anonymous Coward · · Score: 0

      Yeah, except that it costs $10,000 per installation for each Unix and Windows box for the software, and it costs $100 for for each Linux box.

      So converting the money spent to actual servers we get:

      430,000 Unix installs
      320,000 Windows installs
      583,000 Linux installs

      So, Linux wins.

    6. Re:The Big Dog Makes The Rules by Anonymous Coward · · Score: 0

      The Unix figure is primarily HP, IBM, and Sun. They pretty much throw in Unix for free when you buy their hardware new. In that case, Linux is probably more expensive than for HP/UX, AIX, or Solaris. This is made worse by the fact that Red Hat and Suse charge $500 - $2000 for their professional Linux releases which is what you have to run on big hardware, or if you want support.

      So, what it comes down to is your figures don't hold water.

      By the way, if you think that a market worth $17 billion / yr whose equipment is used to run corporate America is going to have less influence on standards than a market segment with $2.4 billion / year used primarily as web, compute, or workgroup servers, you're on crack.

      Linux may be influential, but it doesn't even come close to "winning."

  34. Re:How about making more Distros comply first. by lederhosen · · Score: 0, Redundant

    This is wrong.
    Ignore him.

  35. Terrific resource for porters by _|()|\| · · Score: 4, Interesting
    Regardless of whether this results in changes to POSIX or LSB, this analysis is a terrific resource for those porting applications from Unix to Linux. Thank you, Andrew Josey, for poring over not one, but two specifications. Thank you, Open Group for funding the work.

    It was at least a year after we ported to Linux that I noticed a bug related to the nice() system call. Even more strange, it didn't happen on one of the newer Red Hat Linux test systems. This document could have saved us so much time.

    1. Re:Terrific resource for porters by Anonymous Coward · · Score: 0

      The document is also a terrific contribution
      to the LSB. It's likely that several of
      these issues (especially those where the LSB
      has its own definition rather that referring
      to POSIX) are simply oversights, and can
      easily be resolved in the next rev of the LSB.
      Thanks, Open Group!

  36. It's times like this I feel smug... by James+A.+A.+Joyce · · Score: 2, Funny

    ...because I only ever program in raw ANSI C89. You can't beat it for portability. There's only, like, 100 functions.

    Of course, there's no hope for me writing something as simple as id or whoami, but still, I can just laugh when people bitch about standards. :-)

    1. Re:It's times like this I feel smug... by Anonymous Coward · · Score: 0

      > (Score:1, Troll)

      Attack of the Incredibly Humor-Impaired Moderators.

    2. Re:It's times like this I feel smug... by Anonymous Coward · · Score: 0

      #include <stdlib.h>

      int main(void){
      return system("id");
      }

      There you go, raw ANSI, WG14/N869

  37. It's 'Most Stupid' no matter how many... by cnelzie · · Score: 1, Offtopic

    ...time you say 'stupidest' it still won't become a word...

    I find the misues of such a word by a programmer to be quite funny, since programmers can quite often be quite excellent with the written language.

    In fact, I know a few English majors that turned out to be exceptional programmers, since programming is simply a combination of imagination and learning the rules, complex or otherwise, of a new language. This isn't much of a leap from learning the rules of the English language.

    Yeah, go ahead and mod me off-topic, ignore the thread I am responding to why don't you...

    --
    If you ignore the other uses of a tool, does that make the tool less useful, or you less useful?
    1. Re:It's 'Most Stupid' no matter how many... by arkanes · · Score: 2, Interesting
      http://dictionary.reference.com/search?q=stupidest

      Happy now?

      Oh, and while I don't doubt that you know a few English majors that were good at programming, your statement would only make any sense if MOST English majors were good at programming. The thought process for reducing things to simple steps is at odds with the normal authors thought process in my experience.

    2. Re:It's 'Most Stupid' no matter how many... by Larsing · · Score: 1

      The only dictionary that matter is The Oxford Dictionary of the English Language - everything else is just dialect...

      --
      Ethics is what you say you do. Morals is what you actually do.
    3. Re:It's 'Most Stupid' no matter how many... by klk206 · · Score: 1

      People who use the language are the only authority how it is used.

    4. Re:It's 'Most Stupid' no matter how many... by Anonymous Coward · · Score: 0

      Tell that to the French.

    5. Re:It's 'Most Stupid' no matter how many... by orcrist · · Score: 1

      The only dictionary that matter is The Oxford Dictionary of the English Language - everything else is just dialect..

      Says who? Wait, let me guess: The people who believe The Oxford Dictionary is the only one that matters...

      Well for the short response: I guess 'Helicopter' isn't a proper word then? It's not in there.

      As another poster pointed out speakers of the language are the only true authorities; natural languages are just that: natural. They evolve. They are not invented and they don't conform to a written standard; in fact, 95% of the languages in history never even had a written form. Dictionaries attempt (and I should really stress attempt) to record the standard usage. They can't ever prescribe it, and they can't really keep up with it either.

      Last little point: Everyone speaks a dialect. A dialect is a subset of a language, not a substandard version of it, as in "There are x known dialects in y language" -- not "There are also some dialects of language y". There is always at least one dialect. As linguists say (about this common conception of language vs. dialect): 'A language is a dialect with an army and a navy'. The dominant dialects of individual languages are those which happened to enjoy more political/cultural/military power at a crucial juncture in history. If Napolean had been from the Provence 'Langue d'oc' (spelling?) would be 'Standard French' and 'Langue d'oui' would be a 'dialect'. A happy (unhappy?) coincidence; nothing more, nothing less.

      -Chris

      --
      San Francisco values: compassion, tolerance, respect, intelligence
    6. Re:It's 'Most Stupid' no matter how many... by FredGray · · Score: 1
      Well for the short response: I guess 'Helicopter' isn't a proper word then? It's not in there.

      The second edition of the OED does indeed include "helicopter" (An aircraft which derives its lift and propulsive power principally from the action of one or more lifting screws or rotor-blades...).

    7. Re:It's 'Most Stupid' no matter how many... by orcrist · · Score: 1

      Thanks for the info! That's good to hear, though it only confirms my point about dictionaries trying to keep up. How many years after the reality of Helicopters did it get in there? 40? Certainly not less than 30.

      -chris

      --
      San Francisco values: compassion, tolerance, respect, intelligence
    8. Re:It's 'Most Stupid' no matter how many... by Larsing · · Score: 1

      Says who?

      Most English

      people. After all, it's their language...
      In my experience, if you ask an Englishman for the no1 authority on spelling, 9 out of 10 will say the Oxford Dictionary. But hey, that's only asking the one's who are speaking it...

      --
      Ethics is what you say you do. Morals is what you actually do.
    9. Re:It's 'Most Stupid' no matter how many... by orcrist · · Score: 1

      Says who?

      Most English people. After all, it's their language...


      But not only theirs. You might have forgotten that little country on the other side of the Atlantic with one or 2 English speakers. And no, the English speakers in England don't have a greater claim to the language than the other native speakers. Languages are connected to people not to countries. Modern English in England and Modern English in e.g. the U.S. are both descended from middle and old English, whereas old English came from what is now Germany. Are Germans then the true authorities on English?

      Finally, do you expect someone to be an more of an expert on, say, their spleen than a biologist or a doctor? Likewise, the people who are most likely to tell you the facts about a language are Linguists. Speakers will give you their prejudices.

      -chris

      --
      San Francisco values: compassion, tolerance, respect, intelligence
  38. Linux and POSIX by StormReaver · · Score: 1

    Linux should be striving to be POSIX compatible. Extensions are fine (and frequently even necessary) to address problems/omissions of the standard, but they should be separate from the standard implementation.

    I fully endorse the deprecation of gets (it's a truly brain-dead function), but only if it's marked as deprecated and not removed from the system. There are large numbers of (insecure) heavily used programs that use gets() and that are not going to be changed in the near future simple because of time/budget constraints.

    1. Re:Linux and POSIX by Anonymous Coward · · Score: 0

      Did I hear you say "Extensions are fine"?!?!?

      So it's OK for Linux to "Embrace and extend" a standard but no-one else?

      You just pegged slashdot's hypocrisy meter!

  39. Re:WRONG! POSIX does some really dumb things!! by k98sven · · Score: 3, Informative

    POSIX does some dumb things. Ever hear of the gets() function?

    Now correct me if I'm wrong, but I'm pretty sure gets() was defined
    in the ANSI C standard libraries, and these were subsequently adopted by POSIX?

    Not to mention scanf()/sscanf()..

  40. Re:POSIX LSB by TheSunborn · · Score: 4, Informative

    You seem to forget that posix is just a description of what functions a system must implement(If it want to support posix) and how theese functions must behave. It is not a system description.

    Posix is(shuld be) a subset of LSB meaning that a LSB system should support posix, not the other way around.

    Posix have been implemented on hurd,*Nix,linux qnx 6,amiga os(Almost, but contain some problems with the filesystem functions, and fork) and I also think that beos got a posix layer. (Oh and windows got posix support too, you just can't use it together with other windows functions, so that support is rather pointless)

    Martin

  41. Question... by Hard_Code · · Score: 4, Insightful

    What does POSIX have to do with the standard C library? We live in a world where C is no longer the only language used. Why can't the spec be split into "system stuff" and independent "cross-platform (your favorite language) requirements"?

    --

    It's 10 PM. Do you know if you're un-American?
    1. Re:Question... by DylanQuixote · · Score: 1

      UNIX (tm) is written in C. Most other intpreted languages are also written in C. C is like the least common denominator. That's why perl has a POSIX module. I use POSIX 'strftime' all the time, for example.

    2. Re:Question... by EvilTwinSkippy · · Score: 1
      Put 40 C Programmers in a room, ask them to write the same program, you get 39 different copies of the same program. The last guy throws in some inline assembler to be different.

      Ask 40 C++ programmers to write the same program, you get 40 completely different architectures. Ok, 38 differenct architectures, and 2 guys in a fistfight about which version of the standard they are going to use.

      Now beyond those 2, do you honestly see someone writing an operating system based on:

      • Java
      • Fourth
      • Scheme
      • Visual (fill in the blank)
      • Tcl/Perl/Python/Rex/Bash/Korn...
      --
      "Learning is not compulsory... neither is survival."
      --Dr.W.Edwards Deming
    3. Re:Question... by Hard_Code · · Score: 1

      I guess my point is that people program to libraries, not directly to the OS...so instead of having one big monolithic calcified "OPERATING SYSTEM COMMANDMENTS FROM GOD", instead let each language community come up with standard APIs for *their language* and then map them to the particular system as necessary (e.g. Java has its own APIs for threads and files, etc., but each of course is mapped differently to each OS...same for perl, php, most languages...). This way, the operating system just has to support the concepts in some manner or another instead of supporting explicit API calls, which really reduces the variety in operating systems (take a look at most POSIX systems...besides maybe BeOS and QNX, they all look pretty damn identical (and boring)).

      --

      It's 10 PM. Do you know if you're un-American?
    4. Re:Question... by Hard_Code · · Score: 1

      I guess I misunderstood POSIX then...it actually is just a "portable C api" and not really an operating system spec (although you have to grant that an API into something can and does have an influence on the implementation (or potential implementations) of that concept).

      --

      It's 10 PM. Do you know if you're un-American?
    5. Re:Question... by Hard_Code · · Score: 1

      Actually, no I wasn't...if POSIX is dictating where SYSTEM FILES live, I think that is completely distinct from "the api you should support", which would indicate that these two things should be seperating into independent specs.

      --

      It's 10 PM. Do you know if you're un-American?
    6. Re:Question... by Anonymous Coward · · Score: 0

      POSIX.1 does not dictate what files you should have on your system, let alone where those non-existent files should be!

    7. Re:Question... by Anonymous Coward · · Score: 0

      C is the lowest common denominator, but POSIX have also produced FORTRAN and ADA versions of the POSIX.1 API's. For almost all other languages you can wrap the C API easily.

      An OO version of POSIX could be interesting though.

    8. Re:Question... by elflord · · Score: 2, Insightful
      What does POSIX have to do with the standard C library?

      POSIX predates the standard C library. UNIX and C were developed concurrently. ANSI/ISO C-99 did not exist when the first UNIX was written.

      We live in a world where C is no longer the only language used.

      Yes, we do now.

      Why can't the spec be split into "system stuff" and independent "cross-platform (your favorite language) requirements"?

      Not sure what you mean here. The point is that these calls are supposed to work in a cross-platform manner. One can provide hooks to other APIs. However, most popular languages already have built-in operating system functions that wrap APIs (perl, python, java, ruby, tcl), and the notable exception, C++, can easily call C directly.

    9. Re:Question... by elflord · · Score: 1
      I guess my point is that people program to libraries, not directly to the OS...so instead of having one big monolithic calcified "OPERATING SYSTEM COMMANDMENTS FROM GOD", instead let each language community come up with standard APIs for *their language* and then map them to the particular system as necessary

      The problem is that C and C++ don't do this, and have very good reasons for not doing this. The main reason is that the system API of an operating system reflects several capabilities and features of that operating system, and the C and C++ language committies have enough to worry about without getting into the business of operating system feature specification. These languages also do not want to access abstraacted features of the o[perating system -- as low level languages, they are supposed to be able to directly access kernel-level APIs, specification of which again, is way beyond the scope of the standards committees for C and C++.

      This way, the operating system just has to support the concepts in some manner or another instead of supporting explicit API calls,

      How does it support those "concepts" ? If you have a chmod command, why not an accompanying chmod () function ? If a pwd, why not a getcwd() etc etc ? Is is not advantageous to provide to programmers this functionality which is available to sys admins ?

    10. Re:Question... by elflord · · Score: 1
      Actually, no I wasn't...if POSIX is dictating where SYSTEM FILES live, I think that is completely distinct from "the api you should support", which would indicate that these two things should be seperating into independent specs.

      POSIX consists of many different SPECs. They're not really as independent as you might think. For example, it would not make much sense to have chmod work completely differently from chmod()

  42. Re:POSIX LSB by Alan+Shutko · · Score: 4, Informative

    POSIX is a dead standard that hasn't moved ahead in 20 years.

    Except that, well, it's not. There's a new POSIX (ISO/IEC 9945:2002) which is now the same as the Single Unix Specification, V3. The article is about the differences between LSB and this version of the standard.

  43. Re:WRONG! POSIX does some really dumb things!! by Anonymous Coward · · Score: 1, Funny

    (psst... | is or, & is and )

  44. POSIX? by Anonymous Coward · · Score: 0

    I've never heard of POSIX. Is it better than Linux?

  45. what I do by martin-boundary · · Score: 3, Funny
    Right on! What I usually do when I use gets is this:

    char buf[10];
    char dummy[10];

    fgets(dummy, 10, stdin);
    n = strlen(dummy);
    ungetc('\n', stdin);
    for(i = n - 1; i >= 0; i++) {
    ungetc(dummy[i], stdin);
    }

    gets(buf);

    I'll admit it's a bit tedious, but it helps prevent gets overflows.

    1. Re:what I do by Anonymous Coward · · Score: 0

      Ok, in addition to the previous reply that rightfully called this "solution" retarded, I just wanted to add that calling ungetc multiple times isn't guaranteed to work either!

      But, yeah, given that nobody with half a brain would write such a fucked up piece of code anyway, I'll give the poster the benefit of the doubt and consider this a not-terribly-funny joke!

  46. Also: something has always been broken by r6144 · · Score: 2, Informative
    Other posts point out many good reasons (such as dumbness in POSIX, which should not be kept around in another standard), but for certain things (such as threads), the reason is that Linux at the time has not been conforming to POSIX in these aspects, so programmers are expected to pay special attention on Linux compatibility, rather than completely adhering to the POSIX standard, which may save a little effort but will break on many current Linux systems.

    When most Linux systems conform to POSIX behavior on these aspects (for example by using NPTL for threads), the difference can be removed. Before then, programmers should try to make the program work in both POSIX systems and LSB systems.

  47. Re:WRONG! POSIX does some really dumb things!! by Tony-A · · Score: 0, Offtopic

    Computer instructions include arithmetic operations such as ADD or SUB.
    Computer instructions include logical operations such as AND or OR.
    Logical AND is maybe a bit redundant, (illogical AND?), but avoids confusion as a synonym for ADD as in "2 and 2 are 4".
    & is a binary operator which produces the logical AND of its two evaluated parameters.
    && is a flow control operator which evaluates its right-hand parameter only if required to determine the truth value. This is NOT what was referred to.

    ASM goes something like:
    LOAD flags
    AND FLAG_CONSTANT
    JZ around_blah

    C could be as simple as:
    if ( flags & FLAG_CONSTANT ) { blah ; }

  48. That is the STUPIDEST solution I have ever seen! by multipartmixed · · Score: 2, Informative

    It accomplishes NOTHING. First of all, the overflow can still occur if more I/O arrives on stdin between your ungetc and your gets call.

    Secondly, if there was no data on stdin (e.g. closed pipe at other end) and you got unlucky during function initialization, you can overrun the dummy buffer with your strlen call. If there is no data, fgets will not alter dummy in any way, there is no guarantee that it is an ASCIZ string, and you call strlen on it. Boom! At least initialize dummy if you want consistent code behaviour.

    Third, you're doing way too goddamn much work, and it's EXPENSIVE work!

    How about this:

    char buf[10];
    if (fgets(buf, sizeof(buf), stdin) != NULL)
    process_some_data(buf);

    Simpler, cheaper, safer, quicker, easier to read, and not retarded!

    --

    Do daemons dream of electric sleep()?
  49. What if I don't want it where you want it? by Anonymous Coward · · Score: 0

    How do you pick the best location? Should the entire install go under /home/apache? /opt/apache? Or should each part be put where it goes, with config in /etc/apache, data in /var/www, libs in /usr/lib and executables in /usr/bin? Or should it be called 'httpd' as they do in redhat?

    It's not simply a matter of picking one and sticking to it because people have different needs. Some people want their apps under /home/app or /opt/app so that they can add or remove or upgrade whole chunks by themselves. Others want everything put in the FSSSTD locations so that the distro can manage everything. There is no right answer to this question, except to pick a theme and stick with it within a distro. Most do that just fine.

    So learn the rules of the distro you like and get over yourself, or build your own Linux From Scratch.

  50. Re:POSIX LSB by quigonn · · Score: 1

    In fact, RMS himself coined the term "POSIX" (before that, it was called "IEEEIX" *sigh*).

    --
    A monkey is doing the real work for me.
  51. Re:POSIX LSB by leandrod · · Score: 1
    > RMS himself coined the term "POSIX"

    Do you have any references? I could never find a nice history of POSIX.

    --
    Leandro Guimarães Faria Corcete DUTRA
    DA, DBA, SysAdmin, Data Modeller
    GNU Project, Debian GNU/Lin
  52. OO OO OO! Watch the linux monkey dance! by Anonymous Coward · · Score: 0

    You're just saying that because LSB has "Linux" in the name. You'd be crying a river if it were called something like the "BSD Standards Base" or the "Winders Standards Base".

    Eat a dick for lunch, fucko.

  53. better than FUD by Anonymous Coward · · Score: 0

    ...now here's something that linux vendors *should* be worrying about instead of SCO v IBM.

  54. Mod parent up by xant · · Score: 1

    I love this idea. It also nicely circumvents the problems many Unixy programs get when you have spaces in filenames (quite a few windowsy programs as well).

    --
    It's rare that you're presented with a knob whose only two positions are Make History and Flee Your Glorious Destiny.
  55. Do you even know what an operating system IS?? by multipartmixed · · Score: 1
    > instead of having one big monolithic calcified "OPERATING SYSTEM
    > COMMANDMENTS FROM GOD",

    To paraphrase Andrew Tannenbaum, an Operating System is a program which hides the details about the hardware and presents a nice interface to the programmer. [well, that's one aspect.. others including scheduling, etc., but aren't relevant to this discussion]

    Now, how is that interface presented? Function calls would be handy. What are function calls? They are a standard way of passing parameters to another piece of code, executing that code, and return control back to the caller.

    One way of doing this is to push the return address on the stack, push the parameters on the stack, jump to the code to execute, execute it, pop the parameters off the stack, pop the return address off the stack, and jump to it. (Note that it doesn't happen exactly like this on any architecture that I'm aware of.. but that's beside the point).

    Notice that this discussion hasn't included one character of C code yet -- I'm describing assembler-level operations.

    Great! Now we have a way to call functions. But it would be useful to tell programmers how to call them. After all, this is a really annoying description, particularly when calling conventions vary from OS to OS!


    _STRING COPY_
    Entry point is ELF symbol strcpy
    Parameters are passed on the stack, the calling routine is expected to clean up the stack. The entry point is to be jumped to as a subroutine jump. The first parameter on the stack is target address Second parameter on the stack is the ASCIZ string to copy. Except under SPARC architecture, where the first stack element described above is actually register %o0 within the current register window, and the second stack element described above is actually register %oi in the current register window. Except under MOS6502 architecture, where the top two bytes of the stack contain the return value as stored by the JSR call and be pushed back to their correct place when the RET is called, and so the first stack parameter described above actually becomes the third stack parameter, and the second stack parameter described above actually becomes the fourth. Except under MIPS architecture where....
    ...well, you get the idea. So we have to have a better way to describe this. How about this?

    void cdecl strcpy(*s1, *s2);

    s1 is the target buffer; s2 is an ASCIZ string.

    Hmm, seems simpler to me, and contains all of the requisite information. Now, just because the specification is written in C doesn't mean the routine is only callable in C; it's just a specification for a hunk of assembler, for God's sake!

    It's not hard to translate the specification for use by another language (I know how to do it in VB for God's sake, and I'm sure it can be done in almost any other crap-language-du-jour... well, except Java, because Java doesn't allow direct interfacing with the OS anyhow).

    Note for the pedantic: Yes, I know strcpy() doesn't return void. I was trying to simplify my example by making it procedural.

    Note for the uber pedantic: I included cdecl to make the comparison fair, and because it is actually needed under some of the bastard systems out there with multiple calling conventions... examples include MS-DOS, WIN32, and WCE.

    Note for the people who are missing the point: Yes, I know strcpy() isn't a real OS call, it's just a handy function for examples, because it's so darned simple.
    --

    Do daemons dream of electric sleep()?
  56. POSIX is expensive by Anonymous Coward · · Score: 2, Interesting

    I hope that the LSB standards, which I think are freely downloadable, become the main standard.

    POSIX and all those ISO standards, while good I guess, cost a lot of money.

    This report on the conflicts seems like an attempt to protect the IP value of the POSIX standards. It wants LSB to reference the POSIX standard or other ISO standards everywhere so that people will feel they need to go buy them.

    Free standards to match the freeness of Linux is the way to go.

  57. What is better? by Anonymous Coward · · Score: 0

    a) Linux Standards Base?

    -or-

    b) Posix

    (oops, did I forget the mares?)

  58. Benedict !!! by hey · · Score: 1

    Yikes I didn't know his middle name was Benedict.

    In any case we how can get the POSIX standard. We have the info: the LSB and how POSIX diff's from it.

  59. Re:That is the STUPIDEST solution I have ever seen by dakoda · · Score: 2, Funny

    only on slashdot would a post about how to do something right get modded as flamebait...

  60. LSB or POSIX, it really doesn't matter, because... by James+A.+A.+Joyce · · Score: 1
    ...no "Hello, World!" program should ever need autoconf. This is a version of "Hello, world!" which will compile on any platform and compiler worthy of doing so and is one hundred percent ANSI/ISO C89/C99, POSIX, SUSv2 and SUSv3 C:
    #include <stdio.h>
    #include <stdlib.h>

    /* Some systems suck so hard that they don't define EXIT_SUCCESS in stdlib.h */
    #ifndef EXIT_SUCCESS
    #define EXIT_SUCCESS 0
    #endif

    int main(void)
    {
    puts("Hello, world!");
    exit(EXIT_SUCCESS); /* Some crappy VMS machines don't do "return EXIT_SUCCESS;" right */
    }
    If that doesn't work, get real, get a proper operating system, compiler, and assembler, and do it again. You can't blame source code portability for all the ills of shitty software. Stop making excuses for crappy nonstandard C libraries and get with the program. Standards are important for a reason.

    GNU Hello is pure bloat; no wonder it can't follow ANSI C standards. It can take five options, and it has a feature to output your mail spool. Why?!
  61. it's about time by pauly_thumbs · · Score: 1

    what the heck do we pay you for???? ...

    er i mean ... eh heh ...

    *eeep*

    modded down for minty freshness

  62. Debian is dying by Anonymous Coward · · Score: 0

    The stable distribution is well over a year out of date. If that isn't death, I don't know what is!

  63. What about MKS? by msobkow · · Score: 1

    I think the higher-end MKS Toolkit packages also provide portability code, ala Cygwin. It's pricey, but if a PHB needs a corporation to provide support contracts it's a viable solution.

    --
    I do not fail; I succeed at finding out what does not work.
  64. Externality Problem by David+Hume · · Score: 2, Insightful

    It's a little bit like my opposition to mandatory
    government health warnings on greasy hamburgers.
    Of course they're bad for you, but it's your choice
    to eat them or not. Do you really need a mandatory
    gov't warning?


    I don't think your greasy hamburger example is analogous. If you eat greasy hamburgers and as a result have a poor quality of life, incur horrible medical expenses, and die a miserable death, it is arguably not society's business because all of the costs are internalized. (Unless, of course, you insist on a form of socialized health care where I'm forced to subsidize your health costs and thus your poor nutrition decisions. But that is a debate for another day.)

    However, if in this internet connected world somebody writes a piece of software that is vulnerable to buffer overflow exploits, there is a good chance that as a practical matter all of the costs will not be internalized. The person who wrote the buggy software may bear some of the costs, but not all of them. Where externatlities exist, society arguably has an interest in imposing some standards and reducing one's freedom to make mistakes.

  65. Re:POSIX LSB by Anonymous Coward · · Score: 1, Insightful

    C is a dead language that hasn't moved ahead in 20 years. C++ simply makes official the extensions and common way of doing things that has grown up in the years since C stopped evolving.

    A standards document like this is not a holy book that everyone must use as a daily guide. Every aspect of a standard like this should be constantly under ruthless attack to do things better.

    When I was in the Army every unit I was in had a Standard Operating Procedures (SOP) book. This document formalized the way things were being done at the time. This made it easier to train new people, but if someone came up with a better, easier, faster way of doing things and could get it accepted, guess what? That's right, they updated the book. So various units would evolve slowly overtime to the best way of getting the job done.

    A language like C or C++ is actually merely a "best practices" book and should reflect the best practices of the times, not be some arbitrary thing that documents how things were done 20 years ago.

    Not to mention the fact that C is silent on way too many very important things that govern an actual program.

    If two languages meet ISO/IEC FDIS 14882 standards this is no guarantee that they are compatible in any way shape or form. But if two languages meet the ANSI standard, then you are guaranteed a very high level of interoperablity between the two.

    And there are easy to use tools that actually test compliance to ANSI. It's called gcc.

    Standards are standards, because they don't change fast. Get it?

  66. Linus quote by riptalon · · Score: 3, Informative
    Note that the reason the kernel is not POSIX-compliant is:
    - the POSIX standard is technically stupid.

    Linus Torvalds

    As far as I can see the policy seems to be to comply with the POSIX standard as much as possible, except in cases where it is idiotic, in which case it seems reasonable to implement something better, as in the case of threading:

    POSIX threads is a braindamaged pile of crap.
    Alan Cox
    1. Re:Linus quote by samhalliday · · Score: 1

      i have heard these quotes before; but since 2.6.x is on its way, i noticed that the kernel (and glibc) can have Native POSIX Threads support, which apparently run much faster than before. does anyone know if/why the kernel teams views have changed? and if, as the name suggests, we are indeed getting POSIX compatible threads?

  67. Re:POSIX LSB by JoeBuck · · Score: 1

    Richard Stallman is the person who first suggested the term Posix.

  68. Re:LSB or POSIX, it really doesn't matter, because by __past__ · · Score: 1
    Because it has to demonstrate the GNU way of programming. The GNU way of implementing traditional UNIX programs is adding lots of questionable options to it (so that people get tricked into writing code that won't work on any other system), and not implementing the standard ones completly (so that standard-conforming code won't neccessarily run on a GNU system). A stategy otherwise known as "embrace and extend".

    Of course, bloat is another important quality. You might note that your program therefore doesn't qualify as a part of the GNU system - it doesn't even use gettext! Even their version of /bin/true uses gettext, and supports several command line arguments, but only depending on the POSIXLY_CORRECT env variable (and hence it is much more code than your hello version, and thus obviously better).

    GNU's Not Unix, indeed.

  69. Why we should care by SailorBoy · · Score: 1

    It is my understanding that POSIX is interesting, not for technical reasons, but for political ones. Back when I used to work as a sysadmin for the National Weather Service, it was a common criteria for procuring new systems that the new systems were POSIX compliant. If they weren't compliant, the government wasn't allowed to spend money on them. If we want to be able to sell Linux to the government, we might still need to be POSIX compliant.

    --
    "Violence is the last refuge of the incompetent" --Salvor Hardin
  70. Interoperability by autechre · · Score: 2, Informative

    POSIX doesn't define everything (other posters have pointed out that many of the differences are really extensions because of the GNU tools, which typically have more functionality than their POSIX/Unix equivalents), and having a single set of guidelines will really help to alleviate the "This works on Red Hat but not Mandrake or anything else" problem.

    We'll take your example of RPM. The standard doesn't mean that everyone has to use RPM as their primary package format; they just have to be able to use RPM packages, which Debian can thanks to alien. So if you have an RPM of Commercial-Closed-Source-XYZ, it can be installed on your LSB-compliant system, and it will have a reasonable idea of where to find what it needs.

    KDE and GNOME are cooperating to create common APIs so that software can be written for both at once. This is the same thing. Distributions can still do many things to set them apart from each other, like the strict package management of Debian. But having common ground for developers to target is a huge plus.

    --
    WMBC freeform/independent online radio.
  71. What matters to me by mindstrm · · Score: 2, Interesting

    is consistency. I don't really care if it's POSIX or not. I care if it's consistent.

    Consistency across platforms is more important than POSIX.

    In other wods: If everyone is going to conform to posix completely, fine, let's do it. If one distro or another is going to be "different" by complying, it's not worth it.

  72. It's a JOKE, you mongoloid. by Anonymous Coward · · Score: 0

    Please report to the nearest organ bank for humane termination.

  73. Re:POSIX LSB by Chalst · · Score: 1
    If you have an IEEE membership, you can read:
    The History of Posix: A Study in the Standards Process,
    a short history of POSIX.
  74. #warning? by Ayanami+Rei · · Score: 1

    No, it's not ANSI/ISO-C (btb, if you use -posix, it doesn't work). But it's the linker that throws the warning, not pre-parser. So it isn't implemented that way anyhow.

    That being said, it should be let back in by default (but with lots of red tape around it)

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  75. Not just that by devphil · · Score: 1
    since RMS was behing the original /usr/group that gave birth to POSIX.

    Additional trivia: the name "POSIX" itself was suggested by RMS.

    Unfortunately, in the years since then, his idea of "portable" seems to have become "don't care about other systems, only write your code for GNU/<kernel>, because then users can always just install the GNU system (and will have to if they want your program)."

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    1. Re:Not just that by leandrod · · Score: 1
      > his idea of "portable" seems to have become "don't care about other systems, only write your code for GNU

      Evidence? Seems an unfounded accusation to me.

      --
      Leandro Guimarães Faria Corcete DUTRA
      DA, DBA, SysAdmin, Data Modeller
      GNU Project, Debian GNU/Lin
    2. Re:Not just that by devphil · · Score: 1


      Here's my favorite: Pre-EGCS-fork versions of the GCC manual would encourage coders to not worry about ANSI or ISO C standards, but rather to use as many GNU extensions as they wished, because "it's trivial to simply install GCC." Removing the uglier extensions from GCC has occasionally entailed a fight with RMS, because he feels we shouldn't "slavishly" follow standards such as ISO, ANSI, and POSIX.

      That kind of argument does have merit in other arenas, though... for example, POSIX make is so woefully underspecified that restricting the Makefile syntax to only the forms specified by POSIX is impossible for anything but small projects. It simply doesn't scale. Automatic dependency generation, for instance, requires either a form of "#include" for Makefiles, or rules for the Makefile to rewrite itself. So every implementation of "make" has added file inclusion -- but the syntax is different for each one! So sometimes it's easier to just say, screw it, install {GNU,BSD} Make and use their features.

      RMS tends to take this viewpoint to a political extreme, but then, he's RMS.

      --
      You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    3. Re:Not just that by leandrod · · Score: 1
      > Pre-EGCS-fork versions of the GCC manual would encourage coders to not worry about ANSI or ISO C standards, but rather to use as many GNU extensions as they wished, because "it's trivial to simply install GCC."

      If one doesn't know enough to care about standards, than I agree it's good advice... ;-)

      > the uglier extensions from GCC

      Uglier?

      --
      Leandro Guimarães Faria Corcete DUTRA
      DA, DBA, SysAdmin, Data Modeller
      GNU Project, Debian GNU/Lin
    4. Re:Not just that by devphil · · Score: 1


      Where "ugly" == "causes surprises for the user and maintainence difficulties for the maintainers, due to lack of forethought in design."

      GCC has had a number of features added because they looked cool at the time and the then-maintainers (often RMS himself) didn't consider things like how such extensions could possibly interact with other features. They've been mostly weeded out slowly.

      --
      You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    5. Re:Not just that by leandrod · · Score: 1
      > "ugly" == "causes surprises for the user and maintainence difficulties for the maintainers, due to lack of forethought in design."

      Isn't there any more detailed, online write-up?

      --
      Leandro Guimarães Faria Corcete DUTRA
      DA, DBA, SysAdmin, Data Modeller
      GNU Project, Debian GNU/Lin
    6. Re:Not just that by devphil · · Score: 1


      http://gcc.gnu.org/ml/gcc/

      --
      You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    7. Re:Not just that by leandrod · · Score: 1
      > http://gcc.gnu.org/ml/gcc/

      Nice try, haven't the time. Leave it rest.

      --
      Leandro Guimarães Faria Corcete DUTRA
      DA, DBA, SysAdmin, Data Modeller
      GNU Project, Debian GNU/Lin
    8. Re:Not just that by devphil · · Score: 1


      "Nice try."? I'm completely serious. The issues of GNU extensions versus standard code have come up time and time again, all the way back to the start of the archives. Usually at least one "discussion" avery five or six weeks.

      --
      You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    9. Re:Not just that by leandrod · · Score: 1
      > I'm completely serious

      I believe you, and I really mean it was a nice try. The problem is in my end, I can't bring myself to dig the archives you've pointed me to.

      --
      Leandro Guimarães Faria Corcete DUTRA
      DA, DBA, SysAdmin, Data Modeller
      GNU Project, Debian GNU/Lin
    10. Re:Not just that by 4of12 · · Score: 1

      because "it's trivial to simply install GCC."

      I guess so.

      But it's cheating in my book.

      I doubt that it would be so "trivial" to install gcc or any other piece of GNU software in the old days unless there was a reasonable amount of standards compliance (i.e., POSIX). Even so, they had to jump through more than a few hoops to get portability.

      The existence of autoconf and its friends are testimony to the niggly details of non-compliance to standards.

      I'd like to see the greatest common factor for UNIX systems be increased periodically.

      --
      "Provided by the management for your protection."
  76. Re:POSIX LSB by Anonymous Coward · · Score: 0
    POSIX documents were not previously available on the Net because the IEEE derives income from selling printed copies.

    No thanks.

  77. Re:LSB or POSIX, it really doesn't matter, because by samhalliday · · Score: 1
    GNU Hello is pure bloat; no wonder it can't follow ANSI C standards. It can take five options, and it has a feature to output your mail spool. Why?!

    i hope you are aiming for a funny moderation... because if not, you have missed the point of this program!

    often, the best way to learn something is by example; the GNU auto* tools, internationalisation, localisation and overall package maintenence hierarchy/structure is all documented in this package extremely well. in fact, its only purpose is to serve as a a guidance for people who dont want to reinvent the wheel with these things, and just want to get stuck into writing their program.

    there are ANSI standards, and there are POSIX standards, they are different. is there a standard for the exact path and command line arguments to a c compiler or linker? not that i am aware of...

    the C code itself may be standardised, but often the build environment is not. that is what the GNU tools help you sort out. add to that, the immense need to translate programs to non-english speaking countires and you find yourself needing soemthing like the GNU precedures for that as well (unless you'd care to write your own, which distracts you from your coding...)

    damn, i just fed a troll, didnt i? :-/

  78. Re:WRONG! POSIX does some really dumb things!! by Anonymous Coward · · Score: 0

    The problem with O_LARGEFILE is that if an application assumes that flags have not been set by the system (which is entirely valid according to POSIX) and thus set the flags for the files to the flags they want with the assumption that this only modifies the behavior related to those flags that were explicitly set...inadvertently clearing it.

    It's a big mistake that O_LARGEFILE even needs to exist.

  79. Re:POSIX LSB by leandrod · · Score: 1
    > was overruled by certain commercial vendors committee, who really gave the impression they were doing it just to piss RMS off

    I would love to read all this history in full!

    --
    Leandro Guimarães Faria Corcete DUTRA
    DA, DBA, SysAdmin, Data Modeller
    GNU Project, Debian GNU/Lin
  80. Re:POSIX LSB by leandrod · · Score: 1
    > If you have an IEEE membership

    Haven't!... :-(

    --
    Leandro Guimarães Faria Corcete DUTRA
    DA, DBA, SysAdmin, Data Modeller
    GNU Project, Debian GNU/Lin
  81. Re:Please explain away the whole threading lib by johnnyb · · Score: 1

    I actually like it. You see, with Linux, there are just processes (this may have changed recently, but go with me here). You can have processes that share nothing (like most processes) or processes that share everything (like threads). However, it's more general than that. Processes can share memory, file descriptors, certain regions of memory -- ANYTHING. So, you basically have one concept of processes, and another concept of sharing, and you can share or not share anything you like. Shared nothings are just called "processes" while shared everythings are called "threads", but really there's no technical distinction between the two.

  82. Re:That is the STUPIDEST solution I have ever seen by Anonymous Coward · · Score: 0

    is this because only /. has modding?

  83. Re:POSIX LSB by Arandir · · Score: 3, Informative

    The LSB simply makes official the extensions and common way of doing things that has grown up in the years since POSIX stopped evolving.

    Except that many of these extensions and ways of doing things are only common on Linux systems. A program that adheres to POSIX isn't guaranteed portable to Linux, and a LSB compliant program isn't guaranteed to be portable to Solaris, BSD, AIX, HPUX, etc.

    --
    A Government Is a Body of People, Usually Notably Ungoverned
  84. LSB doesn't prevent competition, it encourages it. by Fenris+Ulf · · Score: 2, Insightful

    The LSB doesn't prevent competition, it encourages it:

    - The LSB prevents distribution lock-in by lending similarity to competing distributions. This reduces pain and training costs when a user changes distributions.

    - The LSB helps new distributions by providing an open documentation of best practices. This reduces research costs and interoperability problems for a company bringing up a brand new distribution.

    The LSB also makes Linux systems in general a lot cleaner. I used to use Slackware in 1995, when it wasn't uncommon to find files in /etc symlinked to three or four different places in the filesystem.

  85. Something GNU by FenderGeek · · Score: 1

    So, my PHB asks me about POSIX and LSB, to which I respond that it's fallout from the SCO FUD, IMHO. Besides, we use AIX from IBM, so there's no worries about LSB, but there is, again, the SCO FUD. But IANAL, I've just got an A+ and a CCNA, so I suggest the PHB take it to the COO, who talks to the CEO, who goes to our law firm RSTL'n'E.


    Hmm...no, still a bit too readable.

    --
    One only needs two tools in life: WD-40 to make things go, and duck tape to make them stop. ~G.M. Weilacher
  86. Re:That is the STUPIDEST solution I have ever seen by Anonymous Coward · · Score: 0

    For the love of god you're an even bigger moron than the parent. No, wait. The parent wasn't being an idiot, it was a joke. Jackass.

    You fail it, you suck at life, etc.

    And you should be using read() anyway.

  87. Re:WRONG! POSIX does some really dumb things!! by moncyb · · Score: 1

    gets() should still be thrown away. It's like saying "please make my program crash and have security problems."

    From the Linux Programmer's Manual man page:

    Never use gets(). Because it is impossible to tell without knowing the data in advance how many characters gets() will read, and because gets() will continue to store characters past the end of the buffer, it is extremely dangerous to use. It has been used to break computer security. Use fgets() instead.
  88. Re:That is the STUPIDEST solution I have ever seen by tesmako · · Score: 1

    Nah, you are mistaken, it does not matter if more data arrives, it will happily be placed at the back of the buffer where it should be. That solution is guaranteed not to cause a buffer overrun. It is unfortunately not guaranteed to work as expected in general anyway, POSIX only specifies that you can ungetc 1 character of input. Therefore the only completely safe use of gets is to set a char to '\n'.

    char c;
    c = '\n';
    if(untegc(&c, stdin) != EOF)
    {
    c = 0;
    gets(&c);
    }

    will set c to '\n' and cannot in any way overrun any buffers. Wonderful isnt it? And it is all POSIX too :)
    Oh, and get a sense of humor, calling actually funny people retarded is not good social style.

  89. Re:POSIX LSB by Anonymous Coward · · Score: 0

    Fabulous. :)

  90. Re:POSIX LSB by Anonymous Coward · · Score: 0

    No. Languages are turing complete, you can solve any problem in any turing complete language, given enough time.

    In other words, you can solve the same problems in C that you can in C++.

    Standards are not turning complete. Standards seek to enumerate the best practices of any given time.

    Nice troll, but way off the mark.

  91. Who has a better implementation? by msobkow · · Score: 1

    Who has a better implementation of pthreads than Linux or AIX? Sun's is their own thread interface that isn't 100% POSIX. HP-UX has historically used DCE threads (aka POSIX draft thread specs.) Win32 is completely incompatible.

    So, pray tell, which is this grail of pthreads implementations that is perfect?

    --
    I do not fail; I succeed at finding out what does not work.
  92. system() in multithreaded code by msobkow · · Score: 1

    Sorry, but if you're using system() to run subprograms, you need to seriously look at the exec() and fork() functions that let you provide the control you want. system() is for quick hacks, not production-grade or threaded code.

    If you think using system/fork-exec to spawn a process is threading, take another look at the POSIX and DCE thread APIs. In neither case is system() or fork() the way that you spawn a thread, but the means of spawning a seperate process.

    --
    I do not fail; I succeed at finding out what does not work.
  93. A better judge of the market by WindBourne · · Score: 1

    $ figures are a poor way to determine the market %'s esp with a non-trivial chunk of the Windows market actually being Linux/BSD and huge number of retrofits on used equipment being Linux. In terms of the server market, I would use the Internet's % as a better judge of what is really running.
    Rationale
    1) A windows-based shop will run MS on their web server unless they are experimenting with OSS.
    2) A unix-based shop will run the unix that is available in their shop. A solaris shop will continue to run Solaris for a web server. This is all true unless they are experimenting with OSS 3) A (Linux|BSD)-based shop will almost certainly run $1. period. end of story. If they are already running OSS, they will not be running a closed source OS. So what are the %'s as outlined by netcraft or other sites? I think Linux's % is far greater than 20%.

    --
    I prefer the "u" in honour as it seems to be missing these days.
    1. Re:A better judge of the market by Anonymous Coward · · Score: 0

      Using the web as a source of statistics for overall market share is a poor measure. Many sites outsource their web site hosting, and this particular market is an unusually strong one for open source software. It also tells you nothing about what is in the server room, or the desktop.

      More than 50% of my desktops are Suns, about 6% are Linux, the rest are Windows. Our web site is outsourced and runs on Windows due to its use of some specific server software. At my last employer the desktops for our division were mostly Macintosh, with some Windows and Unix. The external web site was outsourced and on Windows. An important internal site ran on Linux. Our department web server ran on HP/UX. The corporatation was overwhelmingly Windows, and the corporate site ran on company hardware on Solaris on Ultrasparc servers. My brother's company is planning a web site. His company is 2/3 Macintosh, 1/3 windows, and the web site will almost certainly run on either Linux or a Sun.

      I think that this is a fairly common pattern. You can't reliably tell anything about what is in the server room or desktop by its web site.

      Most servers today are bought with the OS they will use. This is particularly true now that most big vendors sell computers with Linux so there is not a strong reason to change. (I could see a small exception to this for *BSD since so few vendors sell *BSD boxes preconfigured.) I think that its pretty likely that the new sales figures are probably a much closer approximation of the market share than web server statistics.

      I also think you are overlooking the fact that some systems migrate from Linux to Windows. Don't kid yourself, there are people that try Linux and find that its not for them. There are also people that buy a box for a specific purpose and then recycle it later. I just bought a Very well equipped preconfigured Linux box from HP for my company, but it will live as a Linux box for only about 60-90 days. After that it will become a Windows 2000 box. Why? I bought it as a compute server for a short term project that needs the power. After that it will go to a lucky software developer. There is no doubt that particular box will be counted as a Linux sale, but that is only part of the story. Is this sort of thing a big influence on the numbers? Probably not. But then Linux is not a huge percentage of the market either.

      Even if the market share of Linux was huge, it is an irrelevant question. If Linux doesn't conform to existing standards where they exist, and which many other company's products adhere to, it is no better than Microsoft and its "standards."

  94. Re:WRONG! POSIX does some really dumb things!! by Anonymous Coward · · Score: 0

    Not to mention scanf()/sscanf()

    These functions (especially sscanf()) aren't anywhere near as bad as gets(). The main problem with scanf() (apart from idiot users not knowing how to use it) is that if it runs into something it can't digest, it stops processing, leaving whatever's in stdin still there. sscanf() is much better, because it uses a user-supplied string that you presumably got with fgets().

    Just because you can do scanf("%s", buffer); doesn't mean it's a bad function. What about:
    char buffer[100 + 1] = "";
    scanf("%100[^\n]%*[^\n]", buffer);
    if (!feof(stdin) && !ferror(stdin)) getchar();

    Optimize the initialization of buffer if you don't want to waste time setting all 101 locations to zero. But scanf() does have its uses, whereas gets() doesn't.

  95. Re:WRONG! POSIX does some really dumb things!! by Craig+Davison · · Score: 1
    Oops

    char buffer[100 + 1] = "";

    So basically you allocated this nice 101 char buffer on the stack and then overwrote your pointer with a pointer to the constant "".

    char x[5]; /* x, of type char[], points to 5 chars on the stack */
    x = "hello"; /* oops. now x points to "hello" which is in a string table somewhere */

    The rest of your example seems OK.

  96. Yeah, real portable by Anonymous Coward · · Score: 0

    $ echo "puts(\"Hello, world\");" > main.c
    $ gcc -o test main.c
    main.c:1: parse error before string constant
    main.c:1: warning: data definition has no type or storage class

  97. Re:WRONG! POSIX does some really dumb things!! by Anonymous Coward · · Score: 0

    No, char buffer[100 + 1] = "" is equivalent to char buffer[100 + 1] = { '\0' }, which initializes the first element of the array and leaves the contents of the other 100 elements unspecified.

  98. posix documentation licence by Anonymous Coward · · Score: 0

    as many readers had noted, POSIX is avaible here, unfortunately, to download it, you shoud accept a licence that states "However, you are NOT permitted to amend, copy, reprint, offer for sale, or otherwise re-use material from these documents without explicit permission from The Open Group/IEEE." (emphasis added by me)

    i wonder if "writing an opereting system" to be compliant to this documentation is to "reuse material" and in violation of the licence...

    beware what you download and read if you are a kernel developer ;)

  99. Re:WRONG! POSIX does some really dumb things!! by Anonymous Coward · · Score: 0
    Sorry, that's wrong.

    char x[5];
    x = "hello";

    That's not legal. An array is not a modifiable lvalue, and thus can't be assigned to. My example filled buffer up with zeroes. Repeat: an array is not a pointer. an array is not a pointer. an array is not a pointer. thank you.

    The reply to you was wrong, too, but not as wrong:
    char buffer[100 + 1] = "" is equivalent to char buffer[100 + 1] = { '\0' }, which initializes the first element of the array and leaves the contents of the other 100 elements unspecified.

    That's not quite true. The first part's fine, the second is not. It actually initializes the entire array to zero:
    C99 6.7.8p21: If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate, or fewer characters in a string literal used to initialize an array of known size than there are elements in the array, the remainder of the aggregate shall be initialized implicitly the same as objects that have static storage duration.

    And if you don't know about initialization of objects with static storage duration:
    C99 6.7.8p10: If an object that has static storage duration is not initialized explicitly, then:

    if it has pointer type, it is initialized to a null pointer;

    if it has arithmetic type, it is initialized to (positive or unsigned) zero;

    if it is an aggregate, every member is initialized (recursively) according to these rules;

    if it is a union, the first named member is initialized (recursively) according to these rules.

    To complete:
    char buffer[100 + 1] = "";

    That's an aggregate being initialized with a string literal. We all agree that the first element is set to the null character (which has value zero). But since there are fewer characters in the string literal than there are elements in the array, the remaining elements are also set to zero, because they are arithmetic types, and by 6.7.8p10 they are set to zero.

    Just remember that arrays and pointers are distinct types. When you make an array, no matter what, it will always have as much storage as you specified at its declaration. You can't change the size of an array.

    Don't get that confused with a pointer + malloc()/realloc(). A pointer can point to a chunk of memory that might be resizable. Or a pointer can be pointed somewhere else (even to an array, or more commonly, an array's first element). An array isn't a pointer, so it can't be pointed anywhere else.

    int x; /* You always assume there will be room for one int here because it's nonsensical to say you can change where x points. */
    int x[5]; /* The same applies here, although lots of people get this wrong because of the relationship between pointers and arrays. */

    In most expressions, an array name does evaluate to a pointer to its first element. But it's not a pointer! This is, in my opinion, one of the most difficult aspects of C to wrap your head around.

  100. Re:POSIX LSB by Anonymous Coward · · Score: 0

    Posix have been implemented on hurd,*Nix,linux qnx 6,amiga os(Almost, but contain some problems with the filesystem functions, and fork)

    Yeah, but nobody uses hurd.

  101. Re:WRONG! POSIX does some really dumb things!! by Piquan · · Score: 1

    That's not how char[] types work. You're confusing pointers and arrays, which are not equivilent (despite hype to the contrary; RTFAQ). It's a common mistake, but can lead to problems.

    If you try the code you gave, you'll see that it doesn't actually compile; you can't assign to arrays. But the char buffer[100 + 1] = ""; does. That's because it's not an assignment, but an initializer. It sets the initial contents of the buffer that's allocated on the stack; it doesn't move the buffer.

    Don't believe me? Make some stack guards! Try this on an x86 Unix (it will probably work on other boxes). It's not legal C, but it should illustrate the point.

    /* 01 */ #include <stdio.h>
    /* 02 */
    /* 03 */ int
    /* 04 */ main(void)
    /* 05 */ {
    /* 06 */ char* stringtable = "hello world";
    /* 07 */ int lowguard = 69;
    /* 08 */ char buf[4] = "quux";
    /* 09 */ int highguard = 105;
    /* 10 */ printf("lowguard at %p, buf at %p, highguard at %p\n",
    /* 11 */ &lowguard, buf, &highguard);
    /* 12 */ printf ("string table near %p\n", stringtable);
    /* 13 */ printf ("Initial. lowguard: %i highguard: %i\n", lowguard, highguard);
    /* 14 */ printf ("buf as int: %#0x\n", *((int*)buf));
    /* 15 */ printf ("word above lowguard: %#0x\n", *((&lowguard)+1));
    /* 16 */ printf ("word below lowguard: %#0x\n", *((&lowguard)-1));
    /* 17 */ buf[0] = 0xFF;
    /* 18 */ printf ("Byte 0 assigned. lowguard: %i highguard: %i\n", lowguard, highguard);
    /* 19 */ buf[4] = 0xFF;
    /* 20 */ printf ("Overflowed array. lowguard: %i highguard: %i\n", lowguard, highguard);
    /* 21 */ return 0;
    /* 22 */ }

    Compile this and run it. The exact output will, of course, depend on your box. gcc, at least on my architecture (x86/FreeBSD), will generally allocate variables in the order they're declared, if you don't use -O. So you should have the lowguard and highguard immediately around the spot on the stack where the buffer is allocated. Check the first line of output to make sure. The three numbers should be either in order (either increasing or decreasing), and each one four bytes from its neighbor. The string table is probably far-removed from the items on the stack.

    Now, let's examine the consequences.

    Lines 14-16: Note that buf as an int is 0x78757571, which is "quux" in hex. (Remember, this example is for x86 only, although the point it illustrates is applicable to any ANSI C system.) Now, if we read the words directly above and below lowguard, one of those will be buf. This indicates that the string "quux" is allocated on the stack, alongside lowguard.

    Line 17: We didn't compile with -fwritable-strings, so if you're using gcc, this would generate a runtime error (writing to a read-only segment) if buf pointed at a constant in the string segment.

    Line 20: By overflowing the array, we changed one of the guards. Were buf pointing into the string table, then we wouldn't have changed the contents of the stack. (Note the output of line 12: the string table is far away from the stack.)

    This should make it clear that what the AC wrote was an initialized array, not buggy code.

  102. Wanna bet? by hummassa · · Score: 1

    I double your bet your program won't run in all GNU-possible platforms.

    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
    1. Re:Wanna bet? by p3d0 · · Score: 1

      Ok you have a point, though I could probably write it in Perl and sidestep the whole issue. :-)

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  103. Re:WRONG! POSIX does some really dumb things!! by Anonymous Coward · · Score: 0

    Thanks, I didn't realize you couldn't partially initialize an array (I don't have copies of the Standards, though I should). I think I misremembered something about incompletely initializing a struct. Do you happen to know if that also goes for C++ and C89?

  104. Re:WRONG! POSIX does some really dumb things!! by Anonymous Coward · · Score: 0

    Yes, it's true for both C89 and C++98.

    Relevant sections are 6.5.7 for C90 (I don't have C89, but it's the same except for paragraph numbering, I think it's 3.something, probably 3.5.7 in C89), and 8.5 and 8.5.1 in C++98.

    This applies to both arrays and structs.

  105. /usr and /etc may be read only by bluGill · · Score: 1

    It is possibal to run some UNIX version with / mounted read only. However when you do that you break anything that needs to write to /. (It is difficult if not impossibal to put /etc on something other than /) If you really care about secruity you might care that / is read only for an extra level of protection.

    There are even more reasons to run /usr read only. NFS sharing everything in there is common, and do you really want a program you told at to start for you to run on every machine on the network? What a waste. For that matter (Assuming you set things up so at didn't function that way) do you really want every machine on the network to have access to the information of what another machine will run?

    As someone else pointed out, /var is the perfect place for this. A partition defined as a place for things to change often, and unique for each machine. (You can nfs mount email and news which are in /var, but most of the files in /var a specificly different for each machine)

  106. Filesystem innovations by Xaria · · Score: 1

    How about if you're not using a package manager? There are plenty of programs out there that are still only available as binaries or source code, not as packages. RPM isn't the answer to everything. I realise that you can build your own packages, but sometimes you don't want to. I do agree, however, that files that need to be writable probably shouldn't be on /usr, though you then have /usr/local/etc to be concerned about. The /var partition was created for this kind of thing. I'm not sure why this doesn't go in /var/cron myself. An interesting development is the long term plans of ReiserFS. They have a concept of multiple filesystems being mounted at the one point. So, for example, you first mount the system /etc read-write, then you mount a NFS filesystem to /etc read-only for central configs, then you mount another local filesystem to /etc read-write as a user logs in, which contains that user's own configuration files. All programs would then know that configs go in /etc, and no more ~/.everything type directories. In fact, this would allow for separation of configuration from home directories, so that you could have your home directory mounted at whichever workstation you sit down at, but have different configurations depending on what workstation you are on. The filesystem would handle mounting any number of filesystems to /etc, and transparently handle the permissions on the different filesystems mounted at that point. I haven't made it through much of the documentation on the website yet, but it's a very interesting read.

    1. Re:Filesystem innovations by BJH · · Score: 1

      ...though you then have /usr/local/etc to be concerned about. /usr/local is normally created as a separate partition from /usr; it helps with backups, among other things.

      They have a concept of multiple filesystems being mounted at the one point.

      Al Viro's union mount/"stacked" filesystems implementation is intended to do something similar.

  107. "Oh, is that all?" Is this a POSIX Linux offer? by leonbrooks · · Score: 1

    It would be PSB, Posix Standard Base, not as humourous but a lot more functional.

    The system calls in particular seem to be preponderantly a matter of documentation. AFAIK, upwardly compatible extensions aren't an issue at all, eliminating another dozen or so issues. The remainder seem to be trivial enough (e.g. returning EISDIR vs EPERM when rm is aimed at a directory) that they could easily be a kernel config (or even runtime) option.

    It would be relatively trivial to add /sysfs/posix/* for the documented features to allow you to set stuff like "gets(): yes/warn/signal" on the fly. If you did this per-process you could have your LSB and POSIX too. (-:

    The utilities? Well, there's always the POSIXLY_CORRECT and _POSIX2_VERSION envars. The utilities can be knocked over one at a time based on that, and the stuff in glibc like leading zeros can make decisions based on it (I would cache detection of the envars once on process startup lest this become slow).

    What I want to know is: does this Open Group document represent an unofficial/tactful offer to POSIX-certify a version of Linux, presuming compliance?

    --
    Got time? Spend some of it coding or testing
    1. Re:"Oh, is that all?" Is this a POSIX Linux offer? by Anonymous Coward · · Score: 0

      PSB? I thought standards should be called PHB for Dilbert's boss.

  108. Re:POSIX LSB by Wesley+Felter · · Score: 1

    Posix is(shuld be) a subset of LSB...

    Unfortunately that means LSB can't deprecate anything in POSIX, and POSIX is probably not willing to deprecate anything at all, resulting in decades of cruft.

  109. "Located" is a rubbery concept by leonbrooks · · Score: 1

    Put the files in /etc and symlink them into /usr/lib/cron to keep both parties happy (and let me continue to run with /usr mounted readonly). A slightly less bizarre place to put them than cron would be /usr/lib/at if that existed, however I've become accustomed to finding all of my global config files under /etc.

    I do agree that some of POSIX exists for hysterical reasons only, but if it gets people off UnixWare - which is not UnixV3 compliant, and neither is OpenServer - I'm quite happy to have (configurable) breakage added to Linux.

    --
    Got time? Spend some of it coding or testing
  110. The LSB does not control Linux by Wesley+Felter · · Score: 1

    Can someone familiar with the decision making process post a summary of why the LSB group simply didn't choose to implement POSIX rather than creating their own standard?

    The LSB group can't choose those things, because LSB only documents the existing behavior of Linux/glibc. The decisions are actually made by Linus and Ulrich Drepper, and they usually have good reasons when they deviate from POSIX.

  111. MS-Windows is a mess due to randomness not scatter by leonbrooks · · Score: 1
    It doesn't matter where the files go, as long as they go there consistently. MS-Windows apps, including Microsoft's ones, put stuff all over the filesystem (and registry) in a semi-haphazard way. This is very bad, because if it was totally systematic you'd be able to predict where it went, and if it was totally random you'd fire up a search immediately.

    IRL, there seem to be ablout 3 or 4 common ways of arranging files and/or registry entries. Let's take the example of an application which could be considered a utility, something vaguely like MS-Draw or their equation editor.

    • In the Bad Very Old Days, everything would just get dumped into C:\WINDOWS (except that I never called it WINDOWS because some virii had that path hardwired) and/or possibly C:\WINDOWS\SYSTEM and if you were lucky you'd see a NAMEOFAP.INI file there;
    • In the Bad Not So Old Days, the app would either go into C:\NAMEOFAP or C:\BRNDNAME\APPLNAME and maybe C:\WINDOWS would be awarded an .INI file or maybe it's live with the app, or maybe in C:\;
    • In the Bad Moderately Old Days, that usually morphed to C:\ProgramFiles\NameOfApplication (possibly with a \Manufacturer path element squeezed in there (or after MS-Windows borked itself, C:\PROGRA~1\NAMEOF~1) and you'd have both .INI files and registry entries;
    • Nowadays, you might get an \Applicationn.n suffix on the path, and most configuration things live somewhere in the registry so that if that gets corrupted the whole system goes wonky or dies, and every application running under every user now needs write access to all of your config information;
    • Woven in amongst the last two are propensities to jam apps like this into corners like C:\ProgramFiles\CommonFiles or C:\ProgramFiles\MicrosoftOffice\Addins;
    • Of course, now we also have C:\DocumentsandSettings competing with the registry, and things like the menus live here rather than in the registry where you would expect them, and so on.

    That's roughly six and a half changes, to say nothing of the odd application which ignore the existing mess or (MS-Publisher comes to mind) was slow to keep up with it. If Microsoft had had a standard like POSIX or LSB to follow, this wouldn't have happened, and those vendors who broke the guidelines could very reasonably and clearly be reprimanded for their intransignence. However, they've dug their own cesspit, now they have to wallow in it.

    --
    Got time? Spend some of it coding or testing
  112. [OT]Re:WRONG! POSIX does some really dumb things!! by Craig+Davison · · Score: 1

    I guess I was rightfully smacked down for that. Thanks for the clarification, all.

  113. There *are* good reasons by leonbrooks · · Score: 1
    POSIX should be followed unless there is a good reason not to.

    There are some very good reasons for doing stuff differently to POSIX, but most of them relate to simple issues like gets() which could be addressed by a compatibility library or the location of "at" files which can be mostly cured with a symlink.

    Some of the issues are annoying to cure even on POSIX systems because different versions of POSIX sometimes make incompatible recommentations (the case raised by the GNU people was "sort +2" which sorts based on the second field in earlier POSICES and sorts a file called "+2" in later ones. The vast majority of the FSF's GNU tools snap very much into the POSIX line if you run them with POSIXLY_CORRECT=yes.

    --
    Got time? Spend some of it coding or testing
  114. ~/etc/ ~/rc/ or similar by leonbrooks · · Score: 1
    Why isn't this in ~/etc/?

    Damn fine idea.

    Mandrake have noticed how cluttered ~/ gets and now default all (well, many) of their apps to saving stuff in ~/Documents/ instead. It wouldn't be a great conceptual leap from there to add ~/etc/ or ~/rc/ config files to that (only they'd probably want to use something more user-intuitive like ~/Configuration/) but it would take forever to get the several thousand individual upstream application authors to make such a conversion, and they'd have to get Debian, SuSE et al to agree that it was a good idea.

    And hey, it'd break POSIX compliance even further, wouldn't it?

    --
    Got time? Spend some of it coding or testing
  115. Oh, yes, and \ as a path separator in MS-DOS by leonbrooks · · Score: 1
    system ("python \"c:\\\\Program\\ Files\\\\My\\ Program\\\\punkin.py\"");

    How... readable.

    --
    Got time? Spend some of it coding or testing
  116. It's probably waaay too late for this, but... by leonbrooks · · Score: 1

    ...I'd prefer /local/bin, /local/sbin, /local/etc, /local/share "and so on and so forth". Much easier to cope with than nested mounts, particularly if one of them (e.g. /usr) might be NFS and in theory less reliable than local storage.

    --
    Got time? Spend some of it coding or testing
  117. Debian and filesystem layout by leonbrooks · · Score: 1
    Debian has probably the most consistently well-thought out policy for where and how everything gets installed.

    Won't agree 100% but I do like their use of config directories (/etc/pp/ip-{up,down}.d/ for example).

    --
    Got time? Spend some of it coding or testing
  118. That's because MS-Windows is standard now... by leonbrooks · · Score: 1
    ...and if our standards of today<*> aren't good enough for the likes of university students and unemployed people, then they can just buy SFU, can't they?

    Signed: Trey Gates

    * so called because they'll be different tomorrow

    --
    Got time? Spend some of it coding or testing
  119. It would have to be invented first, but... by leonbrooks · · Score: 1
    Fourth? That hasn't been invented yet.

    However, there are several (at least 8 plus 3 MIA) Forth operating systems afoot. Including one which is implemented as a Linux kernel thread.

    --
    Got time? Spend some of it coding or testing
  120. Reposting this AC because I don't have mod points by leonbrooks · · Score: 1

    He'd be +1 Informative if I did

    Using the web as a source of statistics for overall market share is a poor measure. Many sites outsource their web site hosting, and this particular market is an unusually strong one for open source software. It also tells you nothing about what is in the server room, or the desktop.

    More than 50% of my desktops are Suns, about 6% are Linux, the rest are Windows. Our web site is outsourced and runs on Windows due to its use of some specific server software. At my last employer the desktops for our division were mostly Macintosh, with some Windows and Unix. The external web site was outsourced and on Windows. An important internal site ran on Linux. Our department web server ran on HP/UX. The corporatation was overwhelmingly Windows, and the corporate site ran on company hardware on Solaris on Ultrasparc servers. My brother's company is planning a web site. His company is 2/3 Macintosh, 1/3 windows, and the web site will almost certainly run on either Linux or a Sun.

    I think that this is a fairly common pattern. You can't reliably tell anything about what is in the server room or desktop by its web site.

    Most servers today are bought with the OS they will use. This is particularly true now that most big vendors sell computers with Linux so there is not a strong reason to change. (I could see a small exception to this for *BSD since so few vendors sell *BSD boxes preconfigured.) I think that its pretty likely that the new sales figures are probably a much closer approximation of the market share than web server statistics.

    I also think you are overlooking the fact that some systems migrate from Linux to Windows. Don't kid yourself, there are people that try Linux and find that its not for them. There are also people that buy a box for a specific purpose and then recycle it later. I just bought a Very well equipped preconfigured Linux box from HP for my company, but it will live as a Linux box for only about 60-90 days. After that it will become a Windows 2000 box. Why? I bought it as a compute server for a short term project that needs the power. After that it will go to a lucky software developer. There is no doubt that particular box will be counted as a Linux sale, but that is only part of the story. Is this sort of thing a big influence on the numbers? Probably not. But then Linux is not a huge percentage of the market either.

    Even if the market share of Linux was huge, it is an irrelevant question. If Linux doesn't conform to existing standards where they exist, and which many other company's products adhere to, it is no better than Microsoft and its "standards."

    --
    Got time? Spend some of it coding or testing
  121. Re:MS-Windows is a mess due to randomness not scat by Tokerat · · Score: 1


    Well put.

    --
    CAn'T CompreHend SARcaSm?
  122. deprecating gets by epine · · Score: 1


    I take a hard view on issues like this. If the standard body can't get its act together to deprecate a function this misbegotten, I have a hard time listening to anyone argue that compliance with POSIX for the sake of compliance is a good thing.

    A standard codifies practice, and that is the primary work output of a standards body. But the moral authority of the standard does not rest on the fact that it has been endorsed as a standard: the practice it codifies must ultimately provide the moral foundation for its acceptance.

    We all know that gets() should be taken out back by the toolshed and summarily executed. We all know we can't do this, because gets() retains a purely historical legitimacy.

    This is why we invent fancy terms such as 'deprecated', where we admit that we've learned from our mistakes. Back in 1950, the use of CFCs didn't seem like suck a bad idea.

    Once we learned the true effects of CFC on the ozone layer, refusing to deprecate CFC would have called into question the moral authority of the entire chemicals industry.

    gets() pollutes the programming environment every bit as much as CFC destroys the ozone layer. I feel it sabotages the moral authority of the entire programming profession.

    Someone commented that POSIX is in fact a living standard. That would seem to imply that the most recent POSIX standard has failed, once again, to deprecate gets(). To my eye, this is far more damning than if POSIX had remained unchanged for the last twenty years.

    If the people involved in the POSIX standard care about standards and standards compliance, they should care enough to take the minimum necessary measures to sustain their moral authority, or they should be prepared to sit back as the world rallies around alternative codifications of standard practice that does live up to its moral obligations.

    Ultimately, standards have to be earned.

  123. LSB not always better than POSIX by erlkonig · · Score: 2, Interesting

    The LSB does not beat POSIX on all counts, however. Take this section, in particular:

    458 3.3.1 Pathname of $0
    459 When the shell searches for a command name in the PATH and finds a shell
    460 script, ISO/IEC 9945 specifies that it shall pass the command name as
    461 argv[0] and in the child shell script, $0 shall be set from argv[0].
    462 (Note there is a defect report pending on this issue)
    463 However, for an LSB shell, the system may implement either this behavior
    464 or $0 may be set to an absolute pathname of the shell script.

    Consider that only passing the actual command used as $0 (POSIX) allows the user's relative command to be seen literally. If the objective is to find the full pathname of the script, this behavior is annoying, since the PATH must be perused iteratively. However, at least $0 has been be initialized from given, finite data. In constrast, if an implementation follows the LSB's "may be set to an absolute pathname", what happens when the PATH contained "." (don't whine, now, it's still perfectly valid despite security concerns), and the current directory is a couple of thousand levels deep in subdirectories? Now a time consuming search for the root has to proceed, particularly since most shells can't maintain a PWD variable under these conditions. A buffer for the result can't be preallocated, since it will probably be longer than then commonly used PATHLEN or whatever it was (usually about 1024 bytes, I think about 4K in Linux, POSIX might have been shorter), so we're looking at a likely recursive function with the associated impact on the stack (although said impact is a relatively minor problem nowadays).

    If all of these factors aren't handled, than the theoretically simple act of digging up a $0 could crash the script before it executes a single line. If this seems unlikely, note that this same kind of blindness used to crash some versions of Unix (specifically IRIX), due to symlink-handling code in the kernel and a buffer problem - which they wouldn't fix until it was pointed out that creating a USENET newsgroup of sufficiently long name would crash every SGI newsserver on USENET, which would then crash again during the boot fsck's.

    But suppose all that's addressed, and our LSB-option using script mechanism handles the buffer overrun issues and we accept the performance penalty. Only the raw technical issues have been addressed so far.

    Naturally, in searching for the "absolute path", we have to ask which one: the logical path via whatever symlinks might have occured, or the physical path - a classic problem of subjective opinion. Well, if no PWD was maintained, the first may be pretty much unobtainable, but either way, we still have to wonder if someone will complain of the shell's current logical/physical setting for "cd .." should be adhered to. Hardly a recipe for consistancy from the script's perspective, since it wouldn't have yet had an opportunity to set its own preference first.

    So, how could this absolute pathname "option" for $0 possibly be considered an improvement over the POSIX default? Makes me wonder if the lack of this questionable feature was what was posted as a "defect report" against the POSIX guide.

    Hehe. All of this just goes to show that standards writing is a trick business. It's hard to get this kind of thing right in -all- cases.

  124. try it another way by mabhatter654 · · Score: 1
    There's more documented incompatibility between certified versions of "Unix" such as Irix, HP, Sun, etc. than between Linux and any other single "Unix". More than that though, why does the OpenGroup care? These are people who would be very glad for linux to please fall off the earth tommorrow. Why does some minor [OK it could be a big deal later] incompatibility matter...


    Unless, Linux is becoming the "Standard" Unix anyway, without OpenGroup's "permission" and they're trying to hold on for dear life. After all, there is still capitalism at work...the "person" with the most seats sets the standard. Linux is rapidly approaching that point where more people write specificly for Linux than specifically for any of the "offical" unices!


    For all those who pointed out that standards are good. There will be a standard Linux! Everyone else will just have to follow along! The market is slowly choosing...If the OpenGroup is this scared it must be true!

  125. Re:POSIX LSB by quigonn · · Score: 1

    The book "Unix Network Programming" by W. Richard Stevens says so.

    --
    A monkey is doing the real work for me.
  126. Re:POSIX LSB by leandrod · · Score: 1
    > W. Richard Stevens says so

    I hoped for a reason, not an authority.

    --
    Leandro Guimarães Faria Corcete DUTRA
    DA, DBA, SysAdmin, Data Modeller
    GNU Project, Debian GNU/Lin