Hi!
root@stb1:~/src# cat a.c
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
int main(void) {
int fd, rc;
char *s;
struct stat buf;
fd = open("/mnt/aaa",O_RDWR|O_CREAT|O_APPEND,0666);
if (fd == -1) {
printf("Unable to open test file!\n");
exit(0);
}
rc = fstat(fd,&buf);
if (rc != 0) {
s = strerror(errno);
printf("stat rc == %d\nError == '%s'\n",rc,s);
exit(0);
}
rc = write(fd, "kuku", 4);
if (rc == -1) {
s = strerror(errno);
printf("write rc == %d\nError == '%s'\n",rc,s);
}
}
root@stb1:~/src# gcc a.c
a.c: In function ‘main’:
a.c:16:7: warning: incompatible implicit declaration of built-in
function ‘exit’
a.c:22:7: warning: incompatible implicit declaration of built-in
function ‘exit’
root@stb1:~/src# mount -t ceph 10.5.51.230:/ /mnt
root@stb1:~/src# ./a.out
write rc == -1
Error == 'Bad file descriptor'
root@stb1:~/src#
root@stb1:~/src# uname -a
Linux stb1 3.0.0-rc6-ufm #1 SMP Sun Jul 10 14:12:13 EEST 2011 x86_64
x86_64 x86_64 GNU/Linux
root@stb1:~/src#
=========
P.S. In cfuse a.out just hang.
WBR,
Fyodor.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html