alt_sys_wrappers.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef __ALT_SYS_WRAPPERS_H__
  2. #define __ALT_SYS_WRAPPERS_H__
  3. /******************************************************************************
  4. * *
  5. * License Agreement *
  6. * *
  7. * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. *
  8. * All rights reserved. *
  9. * *
  10. * Permission is hereby granted, free of charge, to any person obtaining a *
  11. * copy of this software and associated documentation files (the "Software"), *
  12. * to deal in the Software without restriction, including without limitation *
  13. * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  14. * and/or sell copies of the Software, and to permit persons to whom the *
  15. * Software is furnished to do so, subject to the following conditions: *
  16. * *
  17. * The above copyright notice and this permission notice shall be included in *
  18. * all copies or substantial portions of the Software. *
  19. * *
  20. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  21. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  22. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
  23. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  24. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  25. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  26. * DEALINGS IN THE SOFTWARE. *
  27. * *
  28. * This agreement shall be governed in all respects by the laws of the State *
  29. * of California and by the laws of the United States of America. *
  30. * *
  31. ******************************************************************************/
  32. /*
  33. * This file provides the prototypes for the HAL 'UNIX style functions. The
  34. * names of these functions are defined in alt_syscall.h. THese are defined to
  35. * be the standard names when running the standalone HAL, e.g. open(), close()
  36. * etc., but the names may be redefined as a part of an operating system port
  37. * in order to avoid name clashes.
  38. */
  39. #include "os/alt_syscall.h"
  40. #include <unistd.h>
  41. #include <sys/times.h>
  42. #include <sys/types.h>
  43. #include <sys/stat.h>
  44. #include <sys/time.h>
  45. #include <sys/times.h>
  46. extern int ALT_CLOSE (int __fd);
  47. extern int ALT_EXECVE (const char *__path,
  48. char * const __argv[],
  49. char * const __envp[]);
  50. extern void ALT_EXIT (int __status);
  51. extern int ALT_FSTAT (int file, struct stat *st);
  52. extern int ALT_FCNTL (int file, int cmd, ...);
  53. extern pid_t ALT_FORK (void);
  54. extern pid_t ALT_GETPID (void);
  55. #if defined (__GNUC__) && __GNUC__ >= 4
  56. extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval,
  57. void *ptimezone);
  58. #else
  59. extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval,
  60. struct timezone *ptimezone);
  61. #endif
  62. extern int ALT_IOCTL (int file, int req, void* arg);
  63. extern int ALT_ISATTY (int file);
  64. extern int ALT_KILL (int pid, int sig);
  65. extern int ALT_LINK (const char *existing, const char *new);
  66. extern off_t ALT_LSEEK (int file, off_t ptr, int dir);
  67. extern int ALT_OPEN (const char* file, int flags, ...);
  68. extern int ALT_READ (int file, void *ptr, size_t len);
  69. extern int ALT_RENAME (char *existing, char *new);
  70. extern void* ALT_SBRK (ptrdiff_t incr);
  71. extern int ALT_SETTIMEOFDAY (const struct timeval *t,
  72. const struct timezone *tz);
  73. extern int ALT_STAT (const char *file, struct stat *st);
  74. extern clock_t ALT_TIMES (struct tms *buf);
  75. extern int ALT_UNLINK (const char *name);
  76. #if defined (__GNUC__) && __GNUC__ >= 4
  77. int ALT_USLEEP (useconds_t us);
  78. #else
  79. unsigned int ALT_USLEEP (unsigned int us);
  80. #endif
  81. extern int ALT_WAIT (int *status);
  82. extern int ALT_WRITE (int file, const void *ptr, size_t len);
  83. extern char** ALT_ENVIRON;
  84. /*
  85. *
  86. */
  87. #endif /* __ALT_SYS_WRAPPERS_H__ */