Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jun 2006 11:17:46 +1000
From:      Andrew Reilly <andrew-freebsd@areilly.bpc-users.org>
To:        freebsd-arch@freebsd.org
Subject:   What's up with our stdout?
Message-ID:  <20060625011746.GC81052@duncan.reilly.home>

next in thread | raw e-mail | index | archive | help
Hi all,

My main "workstation" systems are both FreeBSD-STABLE, one an
i386 box (pentium3) and the other an amd64 (Athlon64-X2).  My
diskless/experimental boxes mostly run NetBSD, and I'm currently
working my way up to trying different things, so I've been
trying to cross-compile NetBSD from my FreeBSD boxes, but
running into some problems that prevent it all from working.
(They're typically too puny to do native builds comfortably, but
that's how I've been running so-far.)

One interesting problem that I found yesterday was that NetBSD
have added a "-l" option to cat, which is supposed to apply an
exclusive advisory lock with fcntl to the the output file, and
wait until that succeeds:
http://netbsd.gw.com/cgi-bin/man-cgi?cat++NetBSD-current
That seems like a pretty useful idea,
because it means that you can have parallel make jobs all
contributing to a log file or the like (with cat -l >> foo.log),
without getting in eachothers' way.

However it doesn't work on FreeBSD.  The nbcat that the NetBSD
cross build process makes stops with "nbcat: stdout: Operation
not supported".

OK, that's easy to work around, just remove the -l option from
the $(TOOL_CAT) calls in the NetBSD makefiles, and only run one
job...

The question is: what's wrong with our shell or stdout that a
program (nbcat in this case) can't fcntl-lock the file opened
for output?  Is this related to the /dev/stdout@ -> fd/1 files
that we have?  Seems like a shortcoming to me...

Cheers,

-- 
Andrew



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