cpio.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Extended cpio format from POSIX.1.
  2. This file is part of the GNU C Library.
  3. Copyright (C) 1992, 1998 Free Software Foundation, Inc.
  4. NOTE: The canonical source of this file is maintained with the GNU cpio.
  5. Bugs can be reported to bug-glibc@gnu.org.
  6. The GNU C Library is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU Lesser General Public
  8. License as published by the Free Software Foundation; either
  9. version 2.1 of the License, or (at your option) any later version.
  10. The GNU C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with the GNU C Library; if not, write to the Free
  16. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  17. 02111-1307 USA. */
  18. #ifndef _CPIO_H
  19. #define _CPIO_H 1
  20. /* A cpio archive consists of a sequence of files.
  21. Each file has a 76 byte header,
  22. a variable length, NUL terminated filename,
  23. and variable length file data.
  24. A header for a filename "TRAILER!!!" indicates the end of the archive. */
  25. /* All the fields in the header are ISO 646 (approximately ASCII) strings
  26. of octal numbers, left padded, not NUL terminated.
  27. Field Name Length in Bytes Notes
  28. c_magic 6 must be "070707"
  29. c_dev 6
  30. c_ino 6
  31. c_mode 6 see below for value
  32. c_uid 6
  33. c_gid 6
  34. c_nlink 6
  35. c_rdev 6 only valid for chr and blk special files
  36. c_mtime 11
  37. c_namesize 6 count includes terminating NUL in pathname
  38. c_filesize 11 must be 0 for FIFOs and directories */
  39. /* Value for the field `c_magic'. */
  40. #define MAGIC "070707"
  41. /* Values for c_mode, OR'd together: */
  42. #define C_IRUSR 000400
  43. #define C_IWUSR 000200
  44. #define C_IXUSR 000100
  45. #define C_IRGRP 000040
  46. #define C_IWGRP 000020
  47. #define C_IXGRP 000010
  48. #define C_IROTH 000004
  49. #define C_IWOTH 000002
  50. #define C_IXOTH 000001
  51. #define C_ISUID 004000
  52. #define C_ISGID 002000
  53. #define C_ISVTX 001000
  54. #define C_ISBLK 060000
  55. #define C_ISCHR 020000
  56. #define C_ISDIR 040000
  57. #define C_ISFIFO 010000
  58. #define C_ISSOCK 0140000
  59. #define C_ISLNK 0120000
  60. #define C_ISCTG 0110000
  61. #define C_ISREG 0100000
  62. #endif /* cpio.h */