Displaying 9 results from an estimated 9 matches for "stat_buf".
2002 Jun 26
1
using block devices as harddisks
...chs-1.4.orig/iodev/harddrv.cc bochs-1.4/iodev/harddrv.cc
--- bochs-1.4.orig/iodev/harddrv.cc Mon Mar 25 02:47:14 2002
+++ bochs-1.4/iodev/harddrv.cc Wed Jun 26 09:42:51 2002
@@ -2779,6 +2779,20 @@
if (ret) {
BX_PANIC(("fstat() returns error!"));
}
+ if (S_ISBLK(stat_buf.st_mode))
+ {
+/* it's a block device. st_size will be 0, so set it to the correct size. */
+ if (ioctl(fd_table[i],BLKGETSIZE,&(stat_buf.st_size))==-1)
+ BX_PANIC(("size of block device %s can't be read",pathname));
+ if (stat_buf.st_size > (0x7ffffff/5...
2010 Nov 03
1
kernel bug fixed in later kernels
...gc, char** argv)
{
int fd = open("foo", O_RDONLY);
if (setuid(1000))
{
printf("could not setuid, run as root with correct uid\n");
return 1;
}
char proc_name[1024];
sprintf(proc_name, "/proc/self/fd/%d", fd);
struct stat stat_buf;
int rc = stat(proc_name, &stat_buf);
if (rc == 0)
{
printf("all good\n");
}
else
{
printf("busted, could not access %s\n", proc_name);
}
return rc;
}
-------------- next part --------------
An HTML attachment was scrubbed.....
2002 Nov 03
0
libsmbclient bug ?
...--------
#include <stdio.h>
#include <libsmbclient.h>
void auth_fn(const char *server, const char *share, char *workgroup,
int wgmaxlen, char *username, int unmaxlen,
char *password, int pwmaxlen)
{
password[0] = 0;
}
int main()
{
struct stat stat_buf;
if (0 > smbc_init(auth_fn, 0)) {
perror("smbc_init()");
return 0;
}
if (0 > (smbc_stat("smb://b0di/Muzica/lista", &stat_buf))) {
perror("smbc_stat()");
return 0;...
2012 Jan 26
1
[PATCH v2] libxl: fix mutex initialization
...au@entel.upc.edu>
diff -r f581bb82fecd -r 259112aee618 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Sat Jan 14 19:04:48 2012 +0100
+++ b/tools/libxl/libxl.c Sat Jan 14 19:04:48 2012 +0100
@@ -26,7 +26,6 @@ int libxl_ctx_alloc(libxl_ctx **pctx, in
{
libxl_ctx *ctx = NULL;
struct stat stat_buf;
- const pthread_mutex_t mutex_value = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
int rc;
if (version != LIBXL_VERSION) { rc = ERROR_VERSION; goto out; }
@@ -40,10 +39,10 @@ int libxl_ctx_alloc(libxl_ctx **pctx, in
memset(ctx, 0, sizeof(libxl_ctx));
ctx->lg = lg;
- /*...
2002 Oct 05
2
ogg123 remote interface
..._SIZE;
-
ogg123_options_t options;
-stat_format_t *stat_format;
-buf_t *audio_buffer;
-
-audio_play_arg_t audio_play_arg;
-
+buf_t *audio_buffer_to_cleanup = NULL;
/* ------------------------- config file options -------------------------- */
@@ -280,13 +273,14 @@
int items;
struct stat stat_buf;
int i;
+ buf_t *audio_buffer;
+ audio_play_arg_t audio_play_arg;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
ao_initialize();
- stat_format = stat_format_create();
options_init(&options);
file_options_init(file_opts);...
2004 Sep 30
1
[don@donarmstrong.com: Bug#274301: libflac4 segfaults on corrupt flac files]
...e = 1, rate = 0, channels = 0}
reopen_arg = (audio_reopen_arg_t *) 0x0
eof = 0
eos = 0
ret = 0
nthc = 0
ntimesc = 0
next_status = 0
status_interval = 0
#9 0x0804fd23 in main (argc=2, argv=0xbffff584) at ../../ogg123/ogg123.c:393
optind = 1
playlist_array = (char **) 0x805b8c0
items = 1
stat_buf = {st_dev = 2073, __pad1 = 0, st_ino = 3041522, st_mode = 33188, st_nlink = 1, st_uid = 1000, st_gid = 1000, st_rdev = 0, __pad2 = 0,
st_size = 110592, st_blksize = 4096, st_blocks = 224, st_atim = {tv_sec = 1096585478, tv_nsec = 271352832}, st_mtim = {tv_sec = 1096585268,
tv_nsec = 0}, st_...
2004 Jun 15
3
Repeat patch for ogg123
...gg123/ogg123.c ogg123-mine/ogg123.c
--- ogg123/ogg123.c 2004-06-15 17:21:17.000000000 +0200
+++ ogg123-mine/ogg123.c 2004-06-15 18:34:55.000000000 +0200
@@ -149,6 +149,7 @@
opts->status_freq = 10.0;
opts->playlist = NULL;
+ opts->repeat = 1;
}
@@ -296,6 +297,7 @@
int items;
struct stat stat_buf;
int i;
+ int k;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
@@ -360,21 +362,6 @@
} else
audio_buffer = NULL;
-
- /* Shuffle playlist */
- if (options.shuffle) {
- int i;
-
- srandom(time(NULL));
-
- for (i = 0; i < items; i++) {
- int j = i + random()...
2009 Nov 18
6
[PATCH 1/3] libxenlight: Clean up logging arrangements
* Introduce new variants of the logging functions which include
errno values (converted using strerror) in the messages passed to the
application''s logging callback.
* Use the new errno-including logging functions everywhere where
appropriate. In general, xc_... functions return errno values or 0;
xs_... functions return 0 or -1 (or some such) setting errno.
* When
2010 Aug 12
0
[PATCH, v2]: xl: Implement per-API-call garbage-collection lifetime
...mp;gc);
+ return ret;
}
static int logrename(libxl_ctx *ctx, const char *old, const char *new) {
@@ -176,26 +193,29 @@ static int logrename(libxl_ctx *ctx, con
int libxl_create_logfile(libxl_ctx *ctx, char *name, char **full_name)
{
+ libxl_gc gc = LIBXL_INIT_GC(ctx);
struct stat stat_buf;
char *logfile, *logfile_new;
int i, rc;
- logfile = libxl_sprintf(ctx, "/var/log/xen/%s.log", name);
+ logfile = libxl_sprintf(&gc, "/var/log/xen/%s.log", name);
if (stat(logfile, &stat_buf) == 0) {
/* file exists, rotate */
- logf...