16 #include "mysys_priv.h"
17 #include "mysys_err.h"
19 #ifndef SHARED_LIBRARY
21 const char *globerrs[GLOBERRS]=
23 "Can't create/write to file '%s' (Errcode: %d - %s)",
24 "Error reading file '%s' (Errcode: %d - %s)",
25 "Error writing file '%s' (Errcode: %d - %s)",
26 "Error on close of '%s' (Errcode: %d - %s)",
27 "Out of memory (Needed %u bytes)",
28 "Error on delete of '%s' (Errcode: %d - %s)",
29 "Error on rename of '%s' to '%s' (Errcode: %d - %s)",
31 "Unexpected EOF found when reading file '%s' (Errcode: %d - %s)",
32 "Can't lock file (Errcode: %d - %s)",
33 "Can't unlock file (Errcode: %d - %s)",
34 "Can't read dir of '%s' (Errcode: %d - %s)",
35 "Can't get stat of '%s' (Errcode: %d - %s)",
36 "Can't change size of file (Errcode: %d - %s)",
37 "Can't open stream from handle (Errcode: %d - %s)",
38 "Can't get working directory (Errcode: %d - %s)",
39 "Can't change dir to '%s' (Errcode: %d - %s)",
40 "Warning: '%s' had %d links",
41 "Warning: %d files and %d streams is left open\n",
42 "Disk is full writing '%s' (Errcode: %d - %s). Waiting for someone to free space...",
43 "Can't create directory '%s' (Errcode: %d - %s)",
44 "Character set '%s' is not a compiled character set and is not specified in the '%s' file",
45 "Out of resources when opening file '%s' (Errcode: %d - %s)",
46 "Can't read value for symlink '%s' (Error %d - %s)",
47 "Can't create symlink '%s' pointing at '%s' (Error %d - %s)",
48 "Error on realpath() on '%s' (Error %d - %s)",
49 "Can't sync file '%s' to disk (Errcode: %d - %s)",
50 "Collation '%s' is not a compiled collation and is not specified in the '%s' file",
51 "File '%s' not found (Errcode: %d - %s)",
52 "File '%s' (fileno: %d) was not closed",
53 "Can't change ownership of the file '%s' (Errcode: %d - %s)",
54 "Can't change permissions of the file '%s' (Errcode: %d - %s)",
55 "Can't seek in file '%s' (Errcode: %d - %s)"
58 void init_glob_errs(
void)
67 EE(EE_CANTCREATEFILE) =
"Can't create/write to file '%s' (Errcode: %d - %s)";
68 EE(EE_READ) =
"Error reading file '%s' (Errcode: %d - %s)";
69 EE(EE_WRITE) =
"Error writing file '%s' (Errcode: %d - %s)";
70 EE(EE_BADCLOSE) =
"Error on close of '%'s (Errcode: %d - %s)";
71 EE(EE_OUTOFMEMORY) =
"Out of memory (Needed %u bytes)";
72 EE(EE_DELETE) =
"Error on delete of '%s' (Errcode: %d - %s)";
73 EE(EE_LINK) =
"Error on rename of '%s' to '%s' (Errcode: %d - %s)";
74 EE(EE_EOFERR) =
"Unexpected EOF found when reading file '%s' (Errcode: %d - %s)";
75 EE(EE_CANTLOCK) =
"Can't lock file (Errcode: %d - %s)";
76 EE(EE_CANTUNLOCK) =
"Can't unlock file (Errcode: %d - %s)";
77 EE(EE_DIR) =
"Can't read dir of '%s' (Errcode: %d - %s)";
78 EE(EE_STAT) =
"Can't get stat of '%s' (Errcode: %d - %s)";
79 EE(EE_CANT_CHSIZE) =
"Can't change size of file (Errcode: %d - %s)";
80 EE(EE_CANT_OPEN_STREAM)=
"Can't open stream from handle (Errcode: %d - %s)";
81 EE(EE_GETWD) =
"Can't get working directory (Errcode: %d - %s)";
82 EE(EE_SETWD) =
"Can't change dir to '%s' (Errcode: %d - %s)";
83 EE(EE_LINK_WARNING) =
"Warning: '%s' had %d links";
84 EE(EE_OPEN_WARNING) =
"Warning: %d files and %d streams is left open\n";
85 EE(EE_DISK_FULL) =
"Disk is full writing '%s' (Errcode: %d - %s). Waiting for someone to free space...";
86 EE(EE_CANT_MKDIR) =
"Can't create directory '%s' (Errcode: %d - %s)";
87 EE(EE_UNKNOWN_CHARSET)=
"Character set '%s' is not a compiled character set and is not specified in the %s file";
88 EE(EE_OUT_OF_FILERESOURCES)=
"Out of resources when opening file '%s' (Errcode: %d - %s)";
89 EE(EE_CANT_READLINK)=
"Can't read value for symlink '%s' (Error %d - %s)";
90 EE(EE_CANT_SYMLINK)=
"Can't create symlink '%s' pointing at '%s' (Error %d - %s)";
91 EE(EE_REALPATH)=
"Error on realpath() on '%s' (Error %d - %s)";
92 EE(EE_SYNC)=
"Can't sync file '%s' to disk (Errcode: %d - %s)";
93 EE(EE_UNKNOWN_COLLATION)=
"Collation '%s' is not a compiled collation and is not specified in the %s file";
94 EE(EE_FILENOTFOUND) =
"File '%s' not found (Errcode: %d - %s)";
95 EE(EE_FILE_NOT_CLOSED) =
"File '%s' (fileno: %d) was not closed";
96 EE(EE_CHANGE_OWNERSHIP) =
"Can't change ownership of the file '%s' (Errcode: %d - %s)";
97 EE(EE_CHANGE_PERMISSIONS) =
"Can't change permissions of the file '%s' (Errcode: %d - %s)";
98 EE(EE_CANT_SEEK) =
"Can't seek in file '%s' (Errcode: %d - %s)";
110 void wait_for_free_space(
const char *filename,
int errors)
112 if (!(errors % MY_WAIT_GIVE_USER_A_MESSAGE))
114 char errbuf[MYSYS_STRERROR_SIZE];
115 my_printf_warning(EE(EE_DISK_FULL),
116 filename,my_errno,my_strerror(errbuf,
sizeof(errbuf), my_errno));
117 my_printf_warning(
"Retry in %d secs. Message reprinted in %d secs",
118 MY_WAIT_FOR_USER_TO_FIX_PANIC,
119 MY_WAIT_GIVE_USER_A_MESSAGE * MY_WAIT_FOR_USER_TO_FIX_PANIC );
121 DBUG_EXECUTE_IF(
"simulate_no_free_space_error",
126 (void) sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC);
129 const char **get_global_errmsgs()