search for: o_trunc

Displaying 20 results from an estimated 207 matches for "o_trunc".

2002 Mar 06
1
samba 2.2.3a on PPC
...ap(0x30016000, 4096) = 0 gettimeofday({1015378306, 575771}, NULL) = 0 stat64(0x7fffe538, 0x7fffe938) = -1 ENOENT (No such file or directory) time(NULL) = 1015378306 umask(022) = 022 open("", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = -1 ENOENT (No such file or directory) umask(022) = 022 umask(022) = 022 open("", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = -1 ENOENT (No such file or directory) umask(022) = 022...
2005 Nov 23
2
[LLVMdev] llvm-ranlib: Bus Error in regressions + fix
...OT_READ, MAP_PRIVATE, 3, 0) = 0x40017000 gettimeofday({1132714484, 283020}, NULL) = 0 getpid() = 28656 open("temp.GNU.a-O1Q6E8", O_RDWR|O_CREAT|O_EXCL, 0600) = 4 close(4) = 0 open("temp.GNU.a-O1Q6E8", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4 close(4) = 0 *** SIGNAL HANDLING REMOVED *** open("temp.GNU.a-O1Q6E8", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4 brk(0) = 0x8357000 brk(0x8359000) = 0x8359000 fstat64(4, {st_mode=S_IFREG|0600,...
2003 Jan 06
0
Desktop.ini (part) solution
...dows, the first call creates the file 'test.x' with NORMAL attributes. Then, the second call 'truncates' the file, but with HIDDEN attributes. If you run this on C: you will find test.x has HIDDEN attributes after the second call. This is NOT how un*x behaves, as passing a mode with O_TRUNC has no effect on an existing file (you can test this, the result is different if you place test.x on a samba share). Also, if you reverse the operation (ie hidden first, then normal), the file stays hidden, so the flags seem to be OR'ed with eachother. The quick and dirty fix is to unlink() the...
2007 Apr 17
2
Voicemail files permission
...I needed the files to have modes 660. I tried setting up umask in the script that starts asterisk and that did not help. After some searches I found that the apps/app_voicemail.c sets a define about this: #define VOICEMAIL_FILE_MODE 0600 that is used in: if ((ofd = open(outfile, O_WRONLY | O_TRUNC | O_CREAT, VOICEMAIL_FILE_MODE)) < 0) But no matter what I set in there I always get the files created the same way. Any ideas? -- Gustavo Felisberto (HumpBack) Web: http://dev.gentoo.org/~humpback Blog: http://blog.felisberto.net/ ------------ It's most certainly GNU/Linux, not Linux....
2015 Jun 23
2
[PATCH] lib: Add optional 'append' parameter to copy-(device|file)-to-file APIs.
...++++++++++++++++-------- 2 files changed, 52 insertions(+), 15 deletions(-) diff --git a/daemon/copy.c b/daemon/copy.c index bab00fe..6f3e844 100644 --- a/daemon/copy.c +++ b/daemon/copy.c @@ -30,7 +30,6 @@ #include "actions.h" /* wrflags */ -#define DEST_FILE_FLAGS O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, 0666 #define DEST_DEVICE_FLAGS O_WRONLY|O_CLOEXEC, 0 /* flags */ @@ -210,8 +209,13 @@ copy (const char *src, const char *src_display, int do_copy_device_to_device (const char *src, const char *dest, int64_t srcoffset, int64_t destoffset, int64_t...
2005 Nov 23
0
[LLVMdev] llvm-ranlib: Bus Error in regressions + fix
..., NULL) = 0 > getpid() = 28656 > open("temp.GNU.a-O1Q6E8", O_RDWR|O_CREAT|O_EXCL, 0600) = 4 The temporary file that will contain the symbol table > close(4) = 0 > open("temp.GNU.a-O1Q6E8", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4 > close(4) = 0 Not sure why this is opened twice .. probably an llvm::sys::Path issue. > > *** SIGNAL HANDLING REMOVED *** > > open("temp.GNU.a-O1Q6E8", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4 Open yet again the temnporary file into w...
2013 Jun 05
2
dovecot and time
...(0, "edu.\n\nDr. Johannes Ullrich is Ch"..., 4096) = 3164 read(0, "", 932) = 0 umask(0177) = 077 open("/usr/home/vpopmail/domains/havokmon.com/rick/Maildir/tmp/1370448645.M589211P14191.smtp101", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0777) = 11 umask(077) = 0177 open("/usr/home/vpopmail/domains/havokmon.com/rick/Maildir/dovecot.index.cache", O_RDWR|O_LARGEFILE) = 12 fstat64(12, {st_mode=S_IFREG|0600, st_size=1568768, ...}) = 0 mmap2(NULL, 1568768, PROT_READ, MAP_SHARED, 12...
2012 Jul 09
1
Bug#666135: Multiple "Domain-0", slow libvirt
...-l 2232 From what I can deduce, there is something "wrong" with vm10's xenstored's tdb, because it points to unexisting data and takes a lot of time on that? [vm10 ~]# grep tdb.0x17a47b0 xenstored.strace 2013 open("/var/lib/xenstored/tdb.0x17a47b0", O_WRONLY|O_CREAT|O_TRUNC, 0640) = 154 2013 open("/var/lib/xenstored/tdb.0x17a47b0", O_RDWR) = 155 2013 rename("/var/lib/xenstored/tdb.0x17a47b0", "/var/lib/xenstored/tdb") = 0 2013 unlink("/var/lib/xenstored/tdb.0x17a47b0") = -1 ENOENT (No such file or directory) 2013 open("...
2001 Nov 22
2
Add new user -> swat core dump
...ught] 27542: siginfo: SIGSEGV SEGV_MAPERR addr=0x000000E9 27542: time() = 1006354606 27542: time() = 1006354606 27542: umask(022) = 022 27542: open64("", O_WRONLY|O_CREAT|O_TRUNC, 0666) Err#2 ENOENT 27542: umask(022) = 022 27542: umask(022) = 022 ...[the last lines repeated several times]... 27542: open64("", O_WRONLY|O_CREAT|O_TRUNC, 0666) Err#2 ENOENT 27542: umask(022)...
2015 Jun 23
0
Re: [PATCH] lib: Add optional 'append' parameter to copy-(device|file)-to-file APIs.
...rtions(+), 15 deletions(-) > > diff --git a/daemon/copy.c b/daemon/copy.c > index bab00fe..6f3e844 100644 > --- a/daemon/copy.c > +++ b/daemon/copy.c > @@ -30,7 +30,6 @@ > #include "actions.h" > > /* wrflags */ > -#define DEST_FILE_FLAGS O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, 0666 > #define DEST_DEVICE_FLAGS O_WRONLY|O_CLOEXEC, 0 > > /* flags */ > @@ -210,8 +209,13 @@ copy (const char *src, const char *src_display, > int > do_copy_device_to_device (const char *src, const char *dest, > int64_t srco...
2015 May 26
2
[PATCH] api: Don't truncate /dev/stdout or /dev/stderr when used as FileOut.
In APIs such as guestfs_download, when the FileOut parameter exactly matches "/dev/stdout" or "/dev/stderr", don't reopen the possibly redirected output file with O_TRUNC (truncate). Instead dup the file descriptor. This magic behaviour doesn't happen for /dev/fd/* (or any other output file) allowing callers the choice of using /dev/stderr or /dev/fd/2 depending on whether or not they want truncation. This works around an annoying virt-builder bug. If you do...
2013 Oct 22
2
[PATCH 1/2] Preallocate output file
...ig.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -166,12 +167,12 @@ xzfile_uncompress (const char *filename, const char *outputfile, debug ("uncompressed size = %" PRIu64 " bytes", size); ofd = open (outputfile, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY, 0644); if (ofd == -1) error (EXIT_FAILURE, errno, "open: %s", outputfile); - if (ftruncate (ofd, size) == -1) - error (EXIT_FAILURE, errno, "ftruncate: %s", outputfile); + if (fallocate (ofd, 0, 0, size) == -1) + error (EXIT_FAILURE, errno, "falloc...
2001 May 17
6
scp: Problem when source and destination are identical
If the source and destination file are identical, the receiving scp truncates the file. On the sending end, read() returns 0, and garbage is sent instead of actual data, and the receiving end puts it into the file, which at least confuses the users. -- Florian Weimer Florian.Weimer at RUS.Uni-Stuttgart.DE University of Stuttgart http://cert.uni-stuttgart.de/
2016 Jul 28
2
[PATCH 6/7] qemu: Implement virtio-pstore device
...mp;out_num, sizeof(*req)); > > > + > > > + virtio_pstore_to_filename(s, path, sizeof(path), req); > > > + > > > + type = le16_to_cpu(req->type); > > > + > > > + if (type == VIRTIO_PSTORE_TYPE_DMESG) { > > > + flags |= O_TRUNC; > > > + } else if (type == VIRTIO_PSTORE_TYPE_CONSOLE) { > > > + flags |= O_APPEND; > > > + } > > > + > > > + fd = open(path, flags, 0644); > > > + if (fd < 0) { > > > + error_report("cannot open %s&qu...
2016 Jul 28
2
[PATCH 6/7] qemu: Implement virtio-pstore device
...mp;out_num, sizeof(*req)); > > > + > > > + virtio_pstore_to_filename(s, path, sizeof(path), req); > > > + > > > + type = le16_to_cpu(req->type); > > > + > > > + if (type == VIRTIO_PSTORE_TYPE_DMESG) { > > > + flags |= O_TRUNC; > > > + } else if (type == VIRTIO_PSTORE_TYPE_CONSOLE) { > > > + flags |= O_APPEND; > > > + } > > > + > > > + fd = open(path, flags, 0644); > > > + if (fd < 0) { > > > + error_report("cannot open %s&qu...
2014 Jan 28
0
[PATCH 05/10] examples: Update various examples to use new disk-create API.
.../create-disk.c @@ -17,26 +17,16 @@ main (int argc, char *argv[]) if (g == NULL) { perror ("failed to create libguestfs handle"); exit (EXIT_FAILURE); - } - - /* Create a raw-format sparse disk image, 512 MB in size. */ - int fd = open ("disk.img", O_CREAT|O_WRONLY|O_TRUNC|O_NOCTTY, 0666); - if (fd == -1) { - perror ("disk.img"); - exit (EXIT_FAILURE); - } - if (ftruncate (fd, 512 * 1024 * 1024) == -1) { - perror ("disk.img: truncate"); - exit (EXIT_FAILURE); - } - if (close (fd) == -1) { - perror ("disk.img: close");...
2009 Mar 11
2
ext4 bug & zfs handling of the very same situation
...ta to file x 1d) close file x or 2a) open and read data from file x, close file x 2b) open and truncate file x.new 2c) write data to file x.new 2d) close file x.new 2e) rename file x.new to file x Concerning case 1) I think ZFS may lose data if power is lost right after 1b) and open(xxx,O_WRONLY|O_TRUNC|O_CREAT) is issued in a transaction group separately from the one containing 1c/1d. Concerning case 2) I cannot see ZFS losing any data, because of copy-on-write and transaction grouping. Theodore Ts''o (ext4 developer) commented that both cases are flawed and cannot be supported correctl...
2009 Aug 25
4
[LLVMdev] std::cout << *MyModule does not work anymore
..., llvm::raw_fd_ostream instead of std::ofstream, etc. The changes are not trivial, as for instance llvm::raw_fd_ostream without flags fails if the file exists, but std::ofstream does not. The changes include using new names for flags that already exist on the standard namespace (F_Force instead of O_TRUNC, etc). Is all this an unintended change or an intentional one, and if the later, could you direct me to something that explains what we gain on exchange of this restriction? -- Óscar
2005 Nov 23
0
[LLVMdev] llvm-ranlib: Bus Error in regressions + fix
Evan Jones wrote: > I am pretty certain that this has nothing to do with the C++ library, > and everything to do with the behaviour of mmap when the file that was > mmaped is modified. I actually can reproduce this behaviour with the > attached C test case. The program mmaps a file called 'data,' prints the > last byte, truncates the file, then tries to read the last
2015 Nov 13
4
[PATCH 1/4] extlinux: simplification
...+ char *file; + int fd, rv; + + rv = asprintf(&file, "%s%sldlinux.c32", + path, path[0] && path[strlen(path) - 1] == '/' ? "" : "/"); + if (rv < 0 || !file) { + perror(program); + return 1; + } + + fd = open(file, O_WRONLY | O_TRUNC | O_CREAT | O_SYNC, + S_IRUSR | S_IRGRP | S_IROTH); + if (fd < 0) { + perror(file); + free(file); + return 1; + } + + rv = xpwrite(fd, (const char _force *)syslinux_ldlinuxc32, + syslinux_ldlinuxc32_len, 0); + if (rv != (int)syslinux_ldlinuxc32_len) { + fprintf(stderr, "...