• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: lseek to end?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lseek to end?


  • Subject: Re: lseek to end?
  • From: email@hidden (Peter Seebach)
  • Date: Sat, 05 Apr 2008 19:52:18 -0500

In message <email@hidden>, Nathaniel Gray w
rites:
>Can anybody help me understand why this fails every time with EINVAL
>on Leopard x86?

Prototypes.  Compile with warnings on; you'd have gotten the answer from
the compiler.

>#include <stdio.h>
>#include <fcntl.h>
>#include <assert.h>

You don't have unistd.h.

>     off_t s = lseek(fd, 0, SEEK_END);

Since you didn't declare it, lseek is declared implicit int, and 0 is not
promoted to 64 bits.

The rest follows.

-s
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >lseek to end? (From: Nathaniel Gray <email@hidden>)

  • Prev by Date: lseek to end?
  • Next by Date: Re: Seek to end?
  • Previous by thread: lseek to end?
  • Next by thread: Re: Seek to end?
  • Index(es):
    • Date
    • Thread