summaryrefslogtreecommitdiff
path: root/recipes/glibc/glibc-2.3.2/glibc23-libio-compat.patch
blob: f34a202dc3e94917238b6d027472eb92cdf738fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
--- glibc-2.3.2/libio/libioP.h.orig	2003-10-27 15:48:39.000000000 -0500
+++ glibc-2.3.2/libio/libioP.h	2003-10-27 16:04:03.000000000 -0500
@@ -348,6 +348,17 @@ struct _IO_FILE_plus
   const struct _IO_jump_t *vtable;
 };
 
+#ifdef _IO_USE_OLD_IO_FILE
+/* This structure is used by the compatibility code as if it were an
+   _IO_FILE_plus, but has enough space to initialize the _mode argument
+   of an _IO_FILE_complete.  */
+struct _IO_FILE_complete_plus
+{
+  struct _IO_FILE_complete file;
+  const struct _IO_jump_t *vtable;
+};
+#endif
+
 /* Special file type for fopencookie function.  */
 struct _IO_cookie_file
 {
--- glibc-2.3.2/libio/oldiofdopen.c.orig	2003-10-27 15:57:58.000000000 -0500
+++ glibc-2.3.2/libio/oldiofdopen.c	2003-10-27 16:11:28.000000000 -0500
@@ -48,7 +48,7 @@ _IO_old_fdopen (fd, mode)
   int posix_mode = 0;
   struct locked_FILE
   {
-    struct _IO_FILE_plus fp;
+    struct _IO_FILE_complete_plus fp;
 #ifdef _IO_MTSAFE_IO
     _IO_lock_t lock;
 #endif
@@ -89,7 +89,7 @@ _IO_old_fdopen (fd, mode)
      Open a Stream on a File Descriptor says:
 
          Although not explicitly required by POSIX.1, a good
-         implementation of append ("a") mode would cause the
+         implementation of append ("a") model would cause the
          O_APPEND flag to be set.
 
      (Historical implementations [such as Solaris2] do a one-time
@@ -112,24 +112,24 @@ _IO_old_fdopen (fd, mode)
   if (new_f == NULL)
     return NULL;
 #ifdef _IO_MTSAFE_IO
-  new_f->fp.file._lock = &new_f->lock;
+  new_f->fp.file._file._lock = &new_f->lock;
 #endif
-  _IO_old_init (&new_f->fp.file, 0);
-  _IO_JUMPS (&new_f->fp) = &_IO_old_file_jumps;
-  _IO_old_file_init (&new_f->fp);
+  _IO_old_init (&new_f->fp.file._file, 0);
+  _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fp) = &_IO_old_file_jumps;
+  _IO_old_file_init ((struct _IO_FILE_plus *) &new_f->fp);
 #if  !_IO_UNIFIED_JUMPTABLES
   new_f->fp.vtable = NULL;
 #endif
-  if (_IO_old_file_attach (&new_f->fp.file, fd) == NULL)
+  if (_IO_old_file_attach (&new_f->fp.file._file, fd) == NULL)
     {
-      INTUSE(_IO_un_link) (&new_f->fp);
+      INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) &new_f->fp);
       free (new_f);
       return NULL;
     }
-  new_f->fp.file._flags &= ~_IO_DELETE_DONT_CLOSE;
+  new_f->fp.file._file._flags &= ~_IO_DELETE_DONT_CLOSE;
 
-  new_f->fp.file._IO_file_flags =
-    _IO_mask_flags (&new_f->fp.file, read_write,
+  new_f->fp.file._file._IO_file_flags =
+    _IO_mask_flags (&new_f->fp.file._file, read_write,
 		    _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
 
   return (_IO_FILE *) &new_f->fp;
--- glibc-2.3.2/libio/oldiofopen.c.orig	2003-10-27 15:57:55.000000000 -0500
+++ glibc-2.3.2/libio/oldiofopen.c	2003-10-27 16:11:26.000000000 -0500
@@ -42,7 +42,7 @@ _IO_old_fopen (filename, mode)
 {
   struct locked_FILE
   {
-    struct _IO_FILE_plus fp;
+    struct _IO_FILE_complete_plus fp;
 #ifdef _IO_MTSAFE_IO
     _IO_lock_t lock;
 #endif
@@ -51,17 +51,17 @@ _IO_old_fopen (filename, mode)
   if (new_f == NULL)
     return NULL;
 #ifdef _IO_MTSAFE_IO
-  new_f->fp.file._lock = &new_f->lock;
+  new_f->fp.file._file._lock = &new_f->lock;
 #endif
-  _IO_old_init (&new_f->fp.file, 0);
-  _IO_JUMPS (&new_f->fp) = &_IO_old_file_jumps;
-  _IO_old_file_init (&new_f->fp);
+  _IO_old_init (&new_f->fp.file._file, 0);
+  _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fp) = &_IO_old_file_jumps;
+  _IO_old_file_init ((struct _IO_FILE_plus *) &new_f->fp);
 #if  !_IO_UNIFIED_JUMPTABLES
   new_f->fp.vtable = NULL;
 #endif
   if (_IO_old_file_fopen ((_IO_FILE *) &new_f->fp, filename, mode) != NULL)
     return (_IO_FILE *) &new_f->fp;
-  INTUSE(_IO_un_link) (&new_f->fp);
+  INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) &new_f->fp);
   free (new_f);
   return NULL;
 }
--- glibc-2.3.2/libio/oldiopopen.c.orig	2003-10-27 14:11:13.000000000 -0500
+++ glibc-2.3.2/libio/oldiopopen.c	2003-10-27 16:24:10.000000000 -0500
@@ -100,7 +100,7 @@ extern int _IO_dup2 __P ((int fd, int fd
 
 struct _IO_proc_file
 {
-  struct _IO_FILE_plus file;
+  struct _IO_FILE_complete_plus file;
   /* Following fields must match those in class procbuf (procbuf.h) */
   _IO_pid_t pid;
   struct _IO_proc_file *next;
@@ -219,18 +219,18 @@ _IO_old_popen (command, mode)
   if (new_f == NULL)
     return NULL;
 #ifdef _IO_MTSAFE_IO
-  new_f->fpx.file.file._lock = &new_f->lock;
+  new_f->fpx.file.file._file._lock = &new_f->lock;
 #endif
-  fp = &new_f->fpx.file.file;
-  INTUSE(_IO_init) (fp, 0);
-  _IO_JUMPS (&new_f->fpx.file) = &_IO_old_proc_jumps;
-  _IO_old_file_init (&new_f->fpx.file);
+  fp = &new_f->fpx.file.file._file;
+  _IO_old_init (fp, 0);
+  _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fpx.file) = &_IO_old_proc_jumps;
+  _IO_old_file_init ((struct _IO_FILE_plus *) &new_f->fpx.file);
 #if  !_IO_UNIFIED_JUMPTABLES
   new_f->fpx.file.vtable = NULL;
 #endif
   if (_IO_old_proc_open (fp, command, mode) != NULL)
     return fp;
-  INTUSE(_IO_un_link) (&new_f->fpx.file);
+  INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) &new_f->fpx.file);
   free (new_f);
   return NULL;
 }