9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] fseek
@ 2003-04-18 16:22 David Presotto
  2003-04-25 10:40 ` Douglas A. Gwyn
  0 siblings, 1 reply; 2+ messages in thread
From: David Presotto @ 2003-04-18 16:22 UTC (permalink / raw)
  To: 9fans

It's been pointed out to me that the following functions in
ape/stdio.h are defined differently than POSIX:

extern int fseek(FILE *, long long, int);
extern long long ftell(FILE *);
extern int snprintf(char *, int, const char *, ...);
extern int vsnprintf(char *, int, const char *, va_list);

They should have been:

extern int fseek(FILE *, long, int);
extern long ftell(FILE *);
extern int snprintf(char *, size_t, const char *, ...);
extern int vsnprintf(char *, size_t, const char *, va_list);

I'm going to change them to the standard definitions.
To handle 64 bit offsets, the following are now defined:

extern int fseeko(FILE *, off_t, int);
extern off_t ftello(FILE *);


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

* Re: [9fans] fseek
  2003-04-18 16:22 [9fans] fseek David Presotto
@ 2003-04-25 10:40 ` Douglas A. Gwyn
  0 siblings, 0 replies; 2+ messages in thread
From: Douglas A. Gwyn @ 2003-04-25 10:40 UTC (permalink / raw)
  To: 9fans

David Presotto wrote:
> To handle 64 bit offsets, the following are now defined:
> extern int fseeko(FILE *, off_t, int);
> extern off_t ftello(FILE *);

Hopefully you also have the standard fgetpos, fsetpos.
You're free to typedef fpos_t as long long.

I don't argue against fseeko since it might be more
convenient than making separate fgetpos and fsetpos
calls for relative positioning.  It's not obvious to
me that ftello is needed.


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

end of thread, other threads:[~2003-04-25 10:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-18 16:22 [9fans] fseek David Presotto
2003-04-25 10:40 ` Douglas A. Gwyn

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).