Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.7 KiB

  1. /***
  2. *tell.c - find file position
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * contains _tell() - find file position
  8. *
  9. *Revision History:
  10. * 09-02-83 RN initial version
  11. * 12-11-87 JCR Added "_LOAD_DS" to declaration
  12. * 03-13-90 GJF Replaced _LOAD_DS with _CALLTYPE1, added #include
  13. * <cruntime.h> and fixed the copyright. Also, cleaned
  14. * up the formatting a bit.
  15. * 10-01-90 GJF New-style function declarator.
  16. * 01-17-91 GJF ANSI naming.
  17. * 04-06-93 SKS Replace _CRTAPI* with __cdecl
  18. * 02-15-95 GJF Appended Mac version of source file (somewhat cleaned
  19. * up), with appropriate #ifdef-s.
  20. * 07-09-96 GJF Replaced defined(_WIN32) with !defined(_MAC) and
  21. * defined(_M_M68K) || defined(_M_MPPC) with
  22. * defined(_MAC). Also, detab-ed and cleaned up the
  23. * format a bit.
  24. * 05-17-99 PML Remove all Macintosh support.
  25. *
  26. *******************************************************************************/
  27. #include <cruntime.h>
  28. #include <io.h>
  29. /***
  30. *long _tell(filedes) - find file position
  31. *
  32. *Purpose:
  33. * Gets the current position of the file pointer (no adjustment
  34. * for buffering).
  35. *
  36. *Entry:
  37. * int filedes - file handle of file
  38. *
  39. *Exit:
  40. * returns file position or -1L (sets errno) if bad file descriptor or
  41. * pipe
  42. *
  43. *Exceptions:
  44. *
  45. *******************************************************************************/
  46. long __cdecl _tell (
  47. int filedes
  48. )
  49. {
  50. return(_lseek(filedes,0L,1));
  51. }