Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jun 1995 17:39:39 +0200 (MET DST)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        witr@rwwa.com (Robert Withrow)
Cc:        freebsd-hackers@freebsd.org (FreeBSD hackers)
Subject:   Re: gcc 2.7.0 and FreeBSD 2.0.5
Message-ID:  <199506291539.RAA06569@uriah.heep.sax.de>
In-Reply-To: <199506291444.KAA03119@spooky.rwwa.com> from "Robert Withrow" at Jun 29, 95 10:44:26 am

next in thread | previous in thread | raw e-mail | index | archive | help
As Robert Withrow wrote:
> 
> Out of curiosity, how do you get correct (i.e. posix) behavior
> from shared libraries without weak symbols?  
> 
> If I define my own ``read()'' routine, other posix routines
> which ``act as if they internally call read'' won't call
> *my* read() will they? (In FBSD2.0.5 I mean).  If they do,
> this is broken (non-posix) behavior.

Do you mean something like this?

j@uriah 441% cat > foo.c
#include <stdio.h>

int read(int fd, char *buf, unsigned long l)
{
        printf("read() called\n");
        return 0;
}

int main(void)
{
        char b[100];
        printf("main()\n");
        fgets(b, 100, stdin);
        return 0;
}
^D
j@uriah 442% cc -o foo foo.c
j@uriah 443% ./foo
main()
read() called


-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199506291539.RAA06569>