Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!udel!burdvax!sdcrdcf!trwrb!aero!venera.isi.edu!lmiller From: lmiller@venera.isi.edu.UUCP Newsgroups: comp.lang.c Subject: Re: What real non-UNIX 'C' compilers implement... Message-ID: <3701@venera.isi.edu> Date: Thu, 1-Oct-87 19:01:14 EDT Article-I.D.: venera.3701 Posted: Thu Oct 1 19:01:14 1987 Date-Received: Sun, 4-Oct-87 02:12:30 EDT References: <721@sugar.UUCP> <814@sugar.UUCP> <29156@sun.uucp> <1059@moscom.UUCP> Reply-To: lmiller@venera.isi.edu.UUCP (Larry Miller) Organization: Information Sciences Institute, Univ. of So. California Lines: 27 In article <1059@moscom.UUCP> jgp@moscom.UUCP (Jim Prescott) writes: >In article <29156@sun.uucp> guy%gorodish@Sun.COM (Guy Harris) writes: >>Frankly, *I*'d like to see the distinction between section 2 and section 3 >>erased completely, so that you don't know which library routines consist of a >>little glue and a "trap" call and which don't. > >Another problem with the labeling things as system calls is that a system >call on one system may be a library call on the next. signal() is a system >call on most systems but on BSD 4.[23] it has been changed to a library call. >-- >Jim Prescott moscom!jgp@cs.rochester.edu > {rutgers,ames,cmcl2}!rochester!moscom!jgp It is VERY important, for purposes of portability, to make the section 2/ section 3 distinction. That is, C STANDARD library routines, and system calls. Why? Because most programmers, particuarly when faced with something like Turbo C's alphabetical listing of all functions, don't really know the difference. Then try porting DOS calls to UNIX. Further, standard library routines are supposed to perform in a documented way, conforming to the standard. System routines need not. Consequently, from a formal verification standpoint, programs are likely to be safer, more robust. And knowing the distinction allows you to package the stuff that has to be system-dependent in a way that aids portability. Larry Miller USC/ISI