1 /*
2    Bacula(R) - The Network Backup Solution
3 
4    Copyright (C) 2000-2020 Kern Sibbald
5 
6    The original author of Bacula is Kern Sibbald, with contributions
7    from many others, a complete list can be found in the file AUTHORS.
8 
9    You may use this file and others of this release according to the
10    license defined in the LICENSE file, which includes the Affero General
11    Public License, v3.0 ("AGPLv3") and some additional permissions and
12    terms pursuant to its AGPLv3 Section 7.
13 
14    This notice must be preserved when any source code is
15    conveyed and/or propagated.
16 
17    Bacula(R) is a registered trademark of Kern Sibbald.
18 */
19 /*
20  *
21  *   fifo_dev.c  -- low level operations on fifo devices
22  *
23  *     written by, Kern Sibbald, MM
24  *     separated from file_dev.c January 2016f4
25  *
26  */
27 
28 #include "bacula.h"
29 #include "stored.h"
30 
open_device(DCR * dcr,int omode)31 bool fifo_dev::open_device(DCR *dcr, int omode)
32 {
33    return tape_dev::open_device(dcr, omode);
34 }
35 
lseek(DCR * dcr,boffset_t offset,int whence)36 boffset_t fifo_dev::lseek(DCR *dcr, boffset_t offset, int whence)
37 {
38    /* Cannot seek */
39    return 0;
40 }
41 
truncate(DCR * dcr)42 bool fifo_dev::truncate(DCR *dcr)
43 {
44    /* Cannot truncate */
45    return true;
46 }
47 
print_type()48 const char *fifo_dev::print_type()
49 {
50    return "FIFO";
51 }
52 
device_specific_init(JCR * jcr,DEVRES * device)53 int fifo_dev::device_specific_init(JCR *jcr, DEVRES *device)
54 {
55    capabilities |= CAP_STREAM;
56    return 0;
57 }
58 
59