~ubuntu-branches/ubuntu/trusty/tla/trusty

« back to all changes in this revision

Viewing changes to src/docs-hackerlab/texi/safe.texi

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Suffield
  • Date: 2004-05-30 20:13:29 UTC
  • Revision ID: james.westby@ubuntu.com-20040530201329-mgovd2u99mkxi0hf
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@need 3200
 
2
 
 
3
@node An Errorless Front-end to the VU File-system Interface
 
4
@chapter An Errorless Front-end to the VU File-system Interface
 
5
 
 
6
These functions perform I/O but never return errors.  If an error
 
7
occurs, they print a message and abort the program.
 
8
 
 
9
@sp 1
 
10
@need 1750
 
11
@noindent
 
12
@b{* Function} @code{safe_access}@fuindex safe_access
 
13
@*
 
14
@example
 
15
@group
 
16
int safe_access (char * path, int mode);
 
17
@end group
 
18
@group
 
19
@end group
 
20
@end example
 
21
 
 
22
See @strong{vu_access} in @ref{The VU File-system Interface}.
 
23
 
 
24
 
 
25
If mode is F_OK and the file does not exist, return @code{-1}.
 
26
 
 
27
@sp 1
 
28
@need 1750
 
29
@noindent
 
30
@b{* Function} @code{safe_chdir}@fuindex safe_chdir
 
31
@*
 
32
@example
 
33
@group
 
34
int safe_chdir (char * path);
 
35
@end group
 
36
@group
 
37
@end group
 
38
@end example
 
39
 
 
40
See @strong{vu_chdir} in @ref{The VU File-system Interface}.
 
41
 
 
42
@sp 1
 
43
@need 1750
 
44
@noindent
 
45
@b{* Function} @code{safe_chmod}@fuindex safe_chmod
 
46
@*
 
47
@example
 
48
@group
 
49
int safe_chmod (char * path, int mode);
 
50
@end group
 
51
@group
 
52
@end group
 
53
@end example
 
54
 
 
55
See @strong{vu_chmod} in @ref{The VU File-system Interface}.
 
56
 
 
57
@sp 1
 
58
@need 1750
 
59
@noindent
 
60
@b{* Function} @code{safe_chown}@fuindex safe_chown
 
61
@*
 
62
@example
 
63
@group
 
64
int safe_chown (char * path, int owner, int group);
 
65
@end group
 
66
@group
 
67
@end group
 
68
@end example
 
69
 
 
70
See @strong{vu_chown} in @ref{The VU File-system Interface}.
 
71
 
 
72
@sp 1
 
73
@need 1750
 
74
@noindent
 
75
@b{* Function} @code{safe_chroot}@fuindex safe_chroot
 
76
@*
 
77
@example
 
78
@group
 
79
int safe_chroot (char * path);
 
80
@end group
 
81
@group
 
82
@end group
 
83
@end example
 
84
 
 
85
See @strong{vu_chroot} in @ref{The VU File-system Interface}.
 
86
 
 
87
@sp 1
 
88
@need 1750
 
89
@noindent
 
90
@b{* Function} @code{safe_close}@fuindex safe_close
 
91
@*
 
92
@example
 
93
@group
 
94
int safe_close (int fd);
 
95
@end group
 
96
@group
 
97
@end group
 
98
@end example
 
99
 
 
100
See @strong{vu_close} in @ref{The VU File-system Interface}.
 
101
 
 
102
@sp 1
 
103
@need 1750
 
104
@noindent
 
105
@b{* Function} @code{safe_closedir}@fuindex safe_closedir
 
106
@*
 
107
@example
 
108
@group
 
109
int safe_closedir (DIR * dir);
 
110
@end group
 
111
@group
 
112
@end group
 
113
@end example
 
114
 
 
115
See @strong{vu_closedir} in @ref{The VU File-system Interface}.
 
116
 
 
117
@sp 1
 
118
@need 1750
 
119
@noindent
 
120
@b{* Function} @code{safe_fchdir}@fuindex safe_fchdir
 
121
@*
 
122
@example
 
123
@group
 
124
int safe_fchdir (int fd);
 
125
@end group
 
126
@group
 
127
@end group
 
128
@end example
 
129
 
 
130
See @strong{vu_fchdir} in @ref{The VU File-system Interface}.
 
131
 
 
132
@sp 1
 
133
@need 1750
 
134
@noindent
 
135
@b{* Function} @code{safe_fchmod}@fuindex safe_fchmod
 
136
@*
 
137
@example
 
138
@group
 
139
int safe_fchmod (int fd, int mode);
 
140
@end group
 
141
@group
 
142
@end group
 
143
@end example
 
144
 
 
145
See @strong{vu_fchmod} in @ref{The VU File-system Interface}.
 
146
 
 
147
@sp 1
 
148
@need 1750
 
149
@noindent
 
150
@b{* Function} @code{safe_fchown}@fuindex safe_fchown
 
151
@*
 
152
@example
 
153
@group
 
154
int safe_fchown (int fd, int owner, int group);
 
155
@end group
 
156
@group
 
157
@end group
 
158
@end example
 
159
 
 
160
See @strong{vu_fchown} in @ref{The VU File-system Interface}.
 
161
 
 
162
@sp 1
 
163
@need 1750
 
164
@noindent
 
165
@b{* Function} @code{safe_fstat}@fuindex safe_fstat
 
166
@*
 
167
@example
 
168
@group
 
169
int safe_fstat (int fd, struct stat * buf);
 
170
@end group
 
171
@group
 
172
@end group
 
173
@end example
 
174
 
 
175
See @strong{vu_fstat} in @ref{The VU File-system Interface}.
 
176
 
 
177
@sp 1
 
178
@need 1750
 
179
@noindent
 
180
@b{* Function} @code{safe_fsync}@fuindex safe_fsync
 
181
@*
 
182
@example
 
183
@group
 
184
int safe_fsync (int fd);
 
185
@end group
 
186
@group
 
187
@end group
 
188
@end example
 
189
 
 
190
See @strong{vu_fsync} in @ref{The VU File-system Interface}.
 
191
 
 
192
@sp 1
 
193
@need 1750
 
194
@noindent
 
195
@b{* Function} @code{safe_ftruncate}@fuindex safe_ftruncate
 
196
@*
 
197
@example
 
198
@group
 
199
int safe_ftruncate (int fd, long where);
 
200
@end group
 
201
@group
 
202
@end group
 
203
@end example
 
204
 
 
205
See @strong{vu_ftruncate} in @ref{The VU File-system Interface}.
 
206
 
 
207
@sp 1
 
208
@need 1750
 
209
@noindent
 
210
@b{* Function} @code{safe_link}@fuindex safe_link
 
211
@*
 
212
@example
 
213
@group
 
214
int safe_link (char * from, char * to);
 
215
@end group
 
216
@group
 
217
@end group
 
218
@end example
 
219
 
 
220
See @strong{vu_link} in @ref{The VU File-system Interface}.
 
221
 
 
222
@sp 1
 
223
@need 1750
 
224
@noindent
 
225
@b{* Function} @code{safe_lseek}@fuindex safe_lseek
 
226
@*
 
227
@example
 
228
@group
 
229
long safe_lseek (int fd, long offset, int whence);
 
230
@end group
 
231
@group
 
232
@end group
 
233
@end example
 
234
 
 
235
See @strong{vu_lseek} in @ref{The VU File-system Interface}.
 
236
 
 
237
@sp 1
 
238
@need 1750
 
239
@noindent
 
240
@b{* Function} @code{safe_lstat}@fuindex safe_lstat
 
241
@*
 
242
@example
 
243
@group
 
244
int safe_lstat (char * path, struct stat * buf);
 
245
@end group
 
246
@group
 
247
@end group
 
248
@end example
 
249
 
 
250
See @strong{vu_lstat} in @ref{The VU File-system Interface}.
 
251
 
 
252
@sp 1
 
253
@need 1750
 
254
@noindent
 
255
@b{* Function} @code{safe_mkdir}@fuindex safe_mkdir
 
256
@*
 
257
@example
 
258
@group
 
259
int safe_mkdir (char * path, int mode);
 
260
@end group
 
261
@group
 
262
@end group
 
263
@end example
 
264
 
 
265
See @strong{vu_mkdir} in @ref{The VU File-system Interface}.
 
266
 
 
267
@sp 1
 
268
@need 1750
 
269
@noindent
 
270
@b{* Function} @code{safe_open}@fuindex safe_open
 
271
@*
 
272
@example
 
273
@group
 
274
int safe_open (char * path, int flags, int mode);
 
275
@end group
 
276
@group
 
277
@end group
 
278
@end example
 
279
 
 
280
See @strong{vu_open} in @ref{The VU File-system Interface}.
 
281
 
 
282
@sp 1
 
283
@need 1750
 
284
@noindent
 
285
@b{* Function} @code{safe_opendir}@fuindex safe_opendir
 
286
@*
 
287
@example
 
288
@group
 
289
int safe_opendir (DIR ** retv, char * path);
 
290
@end group
 
291
@group
 
292
@end group
 
293
@end example
 
294
 
 
295
See @strong{vu_opendir} in @ref{The VU File-system Interface}.
 
296
 
 
297
@sp 1
 
298
@need 1750
 
299
@noindent
 
300
@b{* Function} @code{safe_read}@fuindex safe_read
 
301
@*
 
302
@example
 
303
@group
 
304
long safe_read (int fd, char * buf, long count);
 
305
@end group
 
306
@group
 
307
@end group
 
308
@end example
 
309
 
 
310
See @strong{vu_read} in @ref{The VU File-system Interface}.
 
311
 
 
312
@sp 1
 
313
@need 1750
 
314
@noindent
 
315
@b{* Function} @code{safe_read_retry}@fuindex safe_read_retry
 
316
@*
 
317
@example
 
318
@group
 
319
long safe_read_retry (int fd, char * buf, long count);
 
320
@end group
 
321
@group
 
322
@end group
 
323
@end example
 
324
 
 
325
See @strong{vu_read_retry} in @ref{The VU File-system Interface}.
 
326
 
 
327
@sp 1
 
328
@need 1750
 
329
@noindent
 
330
@b{* Function} @code{safe_readdir}@fuindex safe_readdir
 
331
@*
 
332
@example
 
333
@group
 
334
int safe_readdir (char ** file_ret, DIR * dir);
 
335
@end group
 
336
@group
 
337
@end group
 
338
@end example
 
339
 
 
340
See @strong{vu_readdir} in @ref{The VU File-system Interface}.
 
341
 
 
342
@sp 1
 
343
@need 1750
 
344
@noindent
 
345
@b{* Function} @code{safe_readlink}@fuindex safe_readlink
 
346
@*
 
347
@example
 
348
@group
 
349
int safe_readlink (char * path, char * buf, int bufsize);
 
350
@end group
 
351
@group
 
352
@end group
 
353
@end example
 
354
 
 
355
See @strong{vu_readlink} in @ref{The VU File-system Interface}.
 
356
 
 
357
@sp 1
 
358
@need 1750
 
359
@noindent
 
360
@b{* Function} @code{safe_rename}@fuindex safe_rename
 
361
@*
 
362
@example
 
363
@group
 
364
int safe_rename (char * from, char * to);
 
365
@end group
 
366
@group
 
367
@end group
 
368
@end example
 
369
 
 
370
See @strong{vu_rename} in @ref{The VU File-system Interface}.
 
371
 
 
372
@sp 1
 
373
@need 1750
 
374
@noindent
 
375
@b{* Function} @code{safe_rmdir}@fuindex safe_rmdir
 
376
@*
 
377
@example
 
378
@group
 
379
int safe_rmdir (char * path);
 
380
@end group
 
381
@group
 
382
@end group
 
383
@end example
 
384
 
 
385
See @strong{vu_rmdir} in @ref{The VU File-system Interface}.
 
386
 
 
387
@sp 1
 
388
@need 1750
 
389
@noindent
 
390
@b{* Function} @code{safe_stat}@fuindex safe_stat
 
391
@*
 
392
@example
 
393
@group
 
394
int safe_stat (char * path, struct stat * buf);
 
395
@end group
 
396
@group
 
397
@end group
 
398
@end example
 
399
 
 
400
See @strong{vu_stat} in @ref{The VU File-system Interface}.
 
401
 
 
402
@sp 1
 
403
@need 1750
 
404
@noindent
 
405
@b{* Function} @code{safe_symlink}@fuindex safe_symlink
 
406
@*
 
407
@example
 
408
@group
 
409
int safe_symlink (char * from, char * to);
 
410
@end group
 
411
@group
 
412
@end group
 
413
@end example
 
414
 
 
415
See @strong{vu_symlink} in @ref{The VU File-system Interface}.
 
416
 
 
417
@sp 1
 
418
@need 1750
 
419
@noindent
 
420
@b{* Function} @code{safe_truncate}@fuindex safe_truncate
 
421
@*
 
422
@example
 
423
@group
 
424
int safe_truncate (char * path, long where);
 
425
@end group
 
426
@group
 
427
@end group
 
428
@end example
 
429
 
 
430
See @strong{vu_truncate} in @ref{The VU File-system Interface}.
 
431
 
 
432
@sp 1
 
433
@need 1750
 
434
@noindent
 
435
@b{* Function} @code{safe_unlink}@fuindex safe_unlink
 
436
@*
 
437
@example
 
438
@group
 
439
int safe_unlink (char * path);
 
440
@end group
 
441
@group
 
442
@end group
 
443
@end example
 
444
 
 
445
See @strong{vu_unlink} in @ref{The VU File-system Interface}.
 
446
 
 
447
@sp 1
 
448
@need 1750
 
449
@noindent
 
450
@b{* Function} @code{safe_utime}@fuindex safe_utime
 
451
@*
 
452
@example
 
453
@group
 
454
int safe_utime (char * path, struct utimbuf * times);
 
455
@end group
 
456
@group
 
457
@end group
 
458
@end example
 
459
 
 
460
See @strong{vu_utime} in @ref{The VU File-system Interface}.
 
461
 
 
462
@sp 1
 
463
@need 1750
 
464
@noindent
 
465
@b{* Function} @code{safe_write}@fuindex safe_write
 
466
@*
 
467
@example
 
468
@group
 
469
long safe_write (int fd, char * buf, long count);
 
470
@end group
 
471
@group
 
472
@end group
 
473
@end example
 
474
 
 
475
See @strong{vu_write} in @ref{The VU File-system Interface}.
 
476
 
 
477
@sp 1
 
478
@need 1750
 
479
@noindent
 
480
@b{* Function} @code{safe_write_retry}@fuindex safe_write_retry
 
481
@*
 
482
@example
 
483
@group
 
484
long safe_write_retry (int fd, t_uchar * buf, int amt);
 
485
@end group
 
486
@group
 
487
@end group
 
488
@end example
 
489
 
 
490
See @strong{vu_write_retry} in @ref{The VU File-system Interface}.
 
491
 
 
492
@sp 1
 
493
@need 1750
 
494
@noindent
 
495
@b{* Function} @code{safe_fcntl}@fuindex safe_fcntl
 
496
@*
 
497
@example
 
498
@group
 
499
int safe_fcntl (int fd, int cmd, long arg);
 
500
@end group
 
501
@group
 
502
@end group
 
503
@end example
 
504
 
 
505
See @strong{vu_fcntl} in @ref{The VU File-system Interface}.
 
506
 
 
507
@sp 1
 
508
@need 1750
 
509
@noindent
 
510
@b{* Function} @code{safe_dup}@fuindex safe_dup
 
511
@*
 
512
@example
 
513
@group
 
514
int safe_dup (int fd);
 
515
@end group
 
516
@group
 
517
@end group
 
518
@end example
 
519
 
 
520
See @strong{vu_dup} in @ref{The VU File-system Interface}.
 
521
 
 
522
@sp 1
 
523
@need 1750
 
524
@noindent
 
525
@b{* Function} @code{safe_dup2}@fuindex safe_dup2
 
526
@*
 
527
@example
 
528
@group
 
529
int safe_dup2 (int fd, int newfd);
 
530
@end group
 
531
@group
 
532
@end group
 
533
@end example
 
534
 
 
535
See @strong{vu_dup2} in @ref{The VU File-system Interface}.
 
536
 
 
537
@sp 1
 
538
@need 1750
 
539
@noindent
 
540
@b{* Function} @code{safe_move_state}@fuindex safe_move_state
 
541
@*
 
542
@example
 
543
@group
 
544
int safe_move_state (int fd, int newfd);
 
545
@end group
 
546
@group
 
547
@end group
 
548
@end example
 
549
 
 
550
See @strong{vu_move_state} in @ref{Establishing VU Handlers}.
 
551
 
 
552
 
 
553
 
 
554