~ubuntu-branches/ubuntu/natty/eglibc/natty-security

« back to all changes in this revision

Viewing changes to libio/wdummyfileops.c

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno
  • Date: 2009-05-05 09:54:14 UTC
  • Revision ID: james.westby@ubuntu.com-20090505095414-c45qsg9ixjheohru
ImportĀ upstreamĀ versionĀ 2.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2007 Free Software Foundation, Inc.
 
2
   This file is part of the GNU C Library.
 
3
 
 
4
   The GNU C Library is free software; you can redistribute it and/or
 
5
   modify it under the terms of the GNU Lesser General Public
 
6
   License as published by the Free Software Foundation; either
 
7
   version 2.1 of the License, or (at your option) any later version.
 
8
 
 
9
   The GNU C Library is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
   Lesser General Public License for more details.
 
13
 
 
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
 
 
19
   As a special exception, if you link the code in this file with
 
20
   files compiled with a GNU compiler to produce an executable,
 
21
   that does not cause the resulting executable to be covered by
 
22
   the GNU Lesser General Public License.  This exception does not
 
23
   however invalidate any other reasons why the executable file
 
24
   might be covered by the GNU Lesser General Public License.
 
25
   This exception applies to code released by its copyright holders
 
26
   in files containing the exception.  */
 
27
 
 
28
#include <assert.h>
 
29
#include <stdio.h>
 
30
#include <stdlib.h>
 
31
#include <libioP.h>
 
32
 
 
33
static void __THROW __attribute__ ((__noreturn__))
 
34
_IO_wfile_wide_char_support_disabled (void)
 
35
{
 
36
  static const char errstr[]
 
37
    = ("The application tried to use wide character I/O, but libc.so"
 
38
       " was compiled\n"
 
39
       "with the OPTION_POSIX_C_LANG_WIDE_CHAR option group disabled.\n");
 
40
  __libc_write (STDERR_FILENO, errstr, sizeof (errstr) - 1);
 
41
  abort ();
 
42
}
 
43
 
 
44
static void
 
45
_IO_wfile_disabled_void_int (_IO_FILE *fp, int x)
 
46
{
 
47
  _IO_wfile_wide_char_support_disabled ();
 
48
}
 
49
 
 
50
static int
 
51
_IO_wfile_disabled_int_int (_IO_FILE *fp, int x)
 
52
{
 
53
  _IO_wfile_wide_char_support_disabled ();
 
54
}
 
55
 
 
56
static int
 
57
_IO_wfile_disabled_int_none (_IO_FILE *fp)
 
58
{
 
59
  _IO_wfile_wide_char_support_disabled ();
 
60
}
 
61
 
 
62
static _IO_size_t
 
63
_IO_wfile_disabled_xsputn (_IO_FILE *fp, const void *data, _IO_size_t n)
 
64
{
 
65
  _IO_wfile_wide_char_support_disabled ();
 
66
}
 
67
 
 
68
static _IO_size_t
 
69
_IO_wfile_disabled_xsgetn (_IO_FILE *fp, void *data, _IO_size_t n)
 
70
{
 
71
  _IO_wfile_wide_char_support_disabled ();
 
72
}
 
73
 
 
74
static _IO_off64_t
 
75
_IO_wfile_disabled_seekoff (_IO_FILE *fp, _IO_off64_t off, int dir, int mode)
 
76
{
 
77
  _IO_wfile_wide_char_support_disabled ();
 
78
}
 
79
 
 
80
static _IO_off64_t
 
81
_IO_wfile_disabled_seekpos (_IO_FILE *fp, _IO_off64_t pos, int flags)
 
82
{
 
83
  _IO_wfile_wide_char_support_disabled ();
 
84
}
 
85
 
 
86
static _IO_FILE *
 
87
_IO_wfile_disabled_setbuf (_IO_FILE *fp, char *buffer, _IO_ssize_t length)
 
88
{
 
89
  _IO_wfile_wide_char_support_disabled ();
 
90
}
 
91
 
 
92
static _IO_ssize_t
 
93
_IO_wfile_disabled_read (_IO_FILE *fp, void *buffer, _IO_ssize_t length)
 
94
{
 
95
  _IO_wfile_wide_char_support_disabled ();
 
96
}
 
97
 
 
98
static _IO_ssize_t
 
99
_IO_wfile_disabled_write (_IO_FILE *fp, const void *buffer, _IO_ssize_t length)
 
100
{
 
101
  _IO_wfile_wide_char_support_disabled ();
 
102
}
 
103
 
 
104
static _IO_off64_t
 
105
_IO_wfile_disabled_seek (_IO_FILE *fp, _IO_off64_t offset, int mode)
 
106
{
 
107
  _IO_wfile_wide_char_support_disabled ();
 
108
}
 
109
 
 
110
static int
 
111
_IO_wfile_disabled_close (_IO_FILE *fp)
 
112
{
 
113
  _IO_wfile_wide_char_support_disabled ();
 
114
}
 
115
 
 
116
static int
 
117
_IO_wfile_disabled_stat (_IO_FILE *fp, void *buf)
 
118
{
 
119
  _IO_wfile_wide_char_support_disabled ();
 
120
}
 
121
 
 
122
static int
 
123
_IO_wfile_disabled_showmanyc (_IO_FILE *fp)
 
124
{
 
125
  _IO_wfile_wide_char_support_disabled ();
 
126
}
 
127
 
 
128
static void
 
129
_IO_wfile_disabled_imbue (_IO_FILE *fp, void *locale)
 
130
{
 
131
  _IO_wfile_wide_char_support_disabled ();
 
132
}
 
133
 
 
134
static const struct _IO_jump_t _IO_wfile_jumps_disabled =
 
135
{
 
136
  JUMP_INIT_DUMMY,
 
137
  JUMP_INIT(finish, _IO_wfile_disabled_void_int),
 
138
  JUMP_INIT(overflow, _IO_wfile_disabled_int_int),
 
139
  JUMP_INIT(underflow, _IO_wfile_disabled_int_none),
 
140
  JUMP_INIT(uflow, _IO_wfile_disabled_int_none),
 
141
  JUMP_INIT(pbackfail, _IO_wfile_disabled_int_int),
 
142
  JUMP_INIT(xsputn, _IO_wfile_disabled_xsputn),
 
143
  JUMP_INIT(xsgetn, _IO_wfile_disabled_xsgetn),
 
144
  JUMP_INIT(seekoff, _IO_wfile_disabled_seekoff),
 
145
  JUMP_INIT(seekpos, _IO_wfile_disabled_seekpos),
 
146
  JUMP_INIT(setbuf, _IO_wfile_disabled_setbuf),
 
147
  JUMP_INIT(sync, _IO_wfile_disabled_int_none),
 
148
  JUMP_INIT(doallocate, _IO_wfile_disabled_int_none),
 
149
  JUMP_INIT(read, _IO_wfile_disabled_read),
 
150
  JUMP_INIT(write, _IO_wfile_disabled_write),
 
151
  JUMP_INIT(seek, _IO_wfile_disabled_seek),
 
152
  JUMP_INIT(close, _IO_wfile_disabled_close),
 
153
  JUMP_INIT(stat, _IO_wfile_disabled_stat),
 
154
  JUMP_INIT(showmanyc, _IO_wfile_disabled_showmanyc),
 
155
  JUMP_INIT(imbue, _IO_wfile_disabled_imbue)
 
156
};
 
157
 
 
158
strong_alias (_IO_wfile_jumps_disabled, _IO_wfile_jumps)
 
159
libc_hidden_data_def (_IO_wfile_jumps)
 
160
strong_alias (_IO_wfile_jumps_disabled, _IO_wfile_jumps_mmap)
 
161
strong_alias (_IO_wfile_jumps_disabled, _IO_wfile_jumps_maybe_mmap)