9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] fd2path
@ 2000-06-30 13:02 Boyd Roberts
  2000-07-03  9:36 ` [9fans] fd2path Douglas A. Gwyn
  0 siblings, 1 reply; 5+ messages in thread
From: Boyd Roberts @ 2000-06-30 13:02 UTC (permalink / raw)
  To: 9fans

I think fd2path's return value should be:

    -1 - error
     0 - pathname returned
    >0 - pathname returned, missing n bytes

In the last case you could loop on calling malloc until
you got the whole thing.  I think all static n byte buffer
writing functions should act like this and all return values
should be nul terminated.  Can't be hard to do and it'd make
life easier; a generic fd2path that uses a dynamically malloc'd
chunk of memory that grows as needs be, returning NULL or
a pointer to the (nul terminated) malloc'd area.

--
Boyd Roberts                               boyd@psycho-basket-case.org

    ``I come over here to kill them cocksuckers, not work for 'em''

          -- Moon Dog, _Pettibone's Law_, John Keene


Sent via Deja.com http://www.deja.com/
Before you buy.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-07-07  1:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-30 13:02 [9fans] fd2path Boyd Roberts
2000-07-03  9:36 ` [9fans] fd2path Douglas A. Gwyn
2000-07-06  6:57   ` Boyd Roberts
2000-07-06 15:11     ` Douglas A. Gwyn
2000-07-07  1:27       ` Boyd Roberts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).