4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 // Disable 64 bit indirections so we can override both functions.
23 #undef _LARGEFILE64_SOURCE
24 #undef _LARGEFILE_SOURCE
25 #undef _FILE_OFFSET_BITS
28 #include "renderfarm.h"
29 #include "renderfarmclient.h"
30 #include "renderfarmfsclient.h"
31 #include "renderfarmfsserver.h"
45 // These are hacks to get all the file I/O libraries to transparently
46 // go over the network without rewriting them.
58 RenderFarmFSClient *renderfarm_fs_global = 0;
61 // open doesn't seem overridable
62 // int open (__const char *path, int flags, ...)
64 // static int (*func)(__const char *__file, int __oflag) = 0;
66 // printf("open %s\n", path);
69 // func = (int(*)(const char *path, int flags))dlsym(RTLD_NEXT, "open");
71 // result = (*func)(path, flags);
76 FILE* fopen(const char *path, const char *mode)
78 static FILE* (*func)(const char *path, const char *mode) = 0;
79 // This pointer is meaningless except on the server.
83 func = (FILE*(*)(const char *path, const char *mode))dlsym(RTLD_NEXT, "fopen");
86 if(!strncmp(path, RENDERFARM_FS_PREFIX, strlen(RENDERFARM_FS_PREFIX)))
88 renderfarm_fs_global->lock();
89 result = renderfarm_fs_global->fopen(path, mode);
90 renderfarm_fs_global->unlock();
93 result = (*func)(path, mode);
98 FILE* fopen64(const char *path, const char *mode)
100 static FILE* (*func)(const char *path, const char *mode) = 0;
101 // This pointer is meaningless except on the server.
105 func = (FILE*(*)(const char *path, const char *mode))dlsym(RTLD_NEXT, "fopen64");
108 if(!strncmp(path, RENDERFARM_FS_PREFIX, strlen(RENDERFARM_FS_PREFIX)))
110 renderfarm_fs_global->lock();
111 result = renderfarm_fs_global->fopen(path, mode);
112 renderfarm_fs_global->unlock();
115 result = (*func)(path, mode);
122 int fclose(FILE *file)
124 static int (*func)(FILE *) = 0;
125 int result = 0, done = 0;
127 func = (int(*)(FILE *))dlsym(RTLD_NEXT, "fclose");
128 //printf("fclose\n");
130 if(renderfarm_fs_global)
132 renderfarm_fs_global->lock();
133 if(renderfarm_fs_global->is_open(file))
135 result = renderfarm_fs_global->fclose(file);
138 renderfarm_fs_global->unlock();
141 if(!done) result = (*func)(file);
145 int fileno (FILE *stream)
147 static int (*func)(FILE *) = 0;
150 func = (int(*)(FILE *))dlsym(RTLD_NEXT, "fileno");
151 if(renderfarm_fs_global)
153 renderfarm_fs_global->lock();
154 if(renderfarm_fs_global->is_open(stream))
156 result = renderfarm_fs_global->fileno(stream);
158 renderfarm_fs_global->unlock();
161 result = (*func)(stream);
165 // int fflush(FILE *file)
167 // static int (*func)(FILE *) = 0;
168 // int result = 0, done = 0;
170 // func = (int(*)(FILE *))dlsym(RTLD_NEXT, "fflush");
171 // //printf("fflush\n");
173 // renderfarm_fs_global->lock();
174 // if(renderfarm_fs_global->is_open(file))
176 // result = renderfarm_fs_global->fflush(file);
179 // renderfarm_fs_global->unlock();
181 // if(!done) result = (*func)(file);
185 int remove (__const char *__filename)
187 static int (*func)(__const char *) = 0;
190 func = (int(*)(__const char *))dlsym(RTLD_NEXT, "remove");
191 //printf("remove\n");
194 if(!strncmp(__filename, RENDERFARM_FS_PREFIX, strlen(RENDERFARM_FS_PREFIX)))
196 renderfarm_fs_global->lock();
197 result = renderfarm_fs_global->remove(__filename);
198 renderfarm_fs_global->unlock();
201 result = (*func)(__filename);
206 int rename (__const char *__old, __const char *__new)
208 static int (*func)(__const char *, __const char *) = 0;
211 func = (int(*)(__const char *, __const char *))dlsym(RTLD_NEXT, "rename");
212 //printf("rename\n");
215 if(!strncmp(__old, RENDERFARM_FS_PREFIX, strlen(RENDERFARM_FS_PREFIX)))
217 renderfarm_fs_global->lock();
218 result = renderfarm_fs_global->rename(__old, __new);
219 renderfarm_fs_global->unlock();
222 result = (*func)(__old, __new);
227 int fgetc (FILE *__stream)
229 static int (*func)(FILE *) = 0;
230 int result = 0, done = 0;
232 func = (int(*)(FILE *))dlsym(RTLD_NEXT, "fgetc");
235 if(renderfarm_fs_global)
237 renderfarm_fs_global->lock();
238 if(renderfarm_fs_global->is_open(__stream))
240 result = renderfarm_fs_global->fgetc(__stream);
243 renderfarm_fs_global->unlock();
246 if(!done) result = (*func)(__stream);
250 int getc (FILE *__stream)
252 return fgetc(__stream);
255 int fputc (int __c, FILE *__stream)
257 static int (*func)(int, FILE *) = 0;
258 int result = 0, done = 0;
260 func = (int(*)(int, FILE *))dlsym(RTLD_NEXT, "fputc");
263 if(renderfarm_fs_global)
265 renderfarm_fs_global->lock();
266 if(renderfarm_fs_global->is_open(__stream))
268 result = renderfarm_fs_global->fputc(__c, __stream);
271 renderfarm_fs_global->unlock();
274 if(!done) result = (*func)(__c, __stream);
278 int putc (int __c, FILE *__stream)
280 return fputc(__c, __stream);
283 size_t fread (void *__restrict __ptr, size_t __size,
284 size_t __n, FILE *__restrict __stream)
286 static int (*func)(void *, size_t, size_t, FILE *) = 0;
290 func = (int(*)(void *, size_t, size_t, FILE *))dlsym(RTLD_NEXT, "fread");
293 if(renderfarm_fs_global)
295 renderfarm_fs_global->lock();
296 if(renderfarm_fs_global->is_open(__stream))
298 result = renderfarm_fs_global->fread(__ptr, __size, __n, __stream);
301 renderfarm_fs_global->unlock();
304 if(!done) result = (*func)(__ptr, __size, __n, __stream);
309 size_t fwrite (__const void *__restrict __ptr, size_t __size,
310 size_t __n, FILE *__restrict __s)
312 static int (*func)(__const void *, size_t, size_t, FILE *) = 0;
316 func = (int(*)(__const void *, size_t, size_t, FILE *))dlsym(RTLD_NEXT, "fwrite");
318 if(renderfarm_fs_global)
320 renderfarm_fs_global->lock();
321 if(renderfarm_fs_global->is_open(__s))
323 result = renderfarm_fs_global->fwrite(__ptr, __size, __n, __s);
326 renderfarm_fs_global->unlock();
329 if(!done) result = (*func)(__ptr, __size, __n, __s);
334 int fseek (FILE *__stream, long int __off, int __whence)
336 static int (*func)(FILE *, long int, int) = 0;
340 func = (int(*)(FILE *, long int, int))dlsym(RTLD_NEXT, "fseek");
343 if(renderfarm_fs_global)
345 renderfarm_fs_global->lock();
346 if(renderfarm_fs_global->is_open(__stream))
348 result = renderfarm_fs_global->fseek(__stream, __off, __whence);
351 renderfarm_fs_global->unlock();
354 if(!done) result = (*func)(__stream, __off, __whence);
359 int fseeko64 (FILE *__stream, __off64_t __off, int __whence)
361 static int (*func)(FILE *, __off64_t, int) = 0;
365 func = (int(*)(FILE *, __off64_t, int))dlsym(RTLD_NEXT, "fseeko64");
366 //printf("fseeko64\n");
368 if(renderfarm_fs_global)
370 renderfarm_fs_global->lock();
371 if(renderfarm_fs_global->is_open(__stream))
373 result = renderfarm_fs_global->fseek(__stream, __off, __whence);
376 renderfarm_fs_global->unlock();
379 if(!done) result = (*func)(__stream, __off, __whence);
384 long int ftell (FILE *__stream)
386 static long int (*func)(FILE *) = 0;
390 func = (long int(*)(FILE *))dlsym(RTLD_NEXT, "ftell");
393 if(renderfarm_fs_global)
395 renderfarm_fs_global->lock();
396 if(renderfarm_fs_global->is_open(__stream))
398 result = renderfarm_fs_global->ftell(__stream);
401 renderfarm_fs_global->unlock();
404 if(!done) result = (*func)(__stream);
409 __off64_t ftello64 (FILE *__stream)
411 static __off64_t (*func)(FILE *) = 0;
412 __off64_t result = 0;
415 func = (__off64_t(*)(FILE *))dlsym(RTLD_NEXT, "ftello64");
417 if(renderfarm_fs_global)
419 renderfarm_fs_global->lock();
420 if(renderfarm_fs_global->is_open(__stream))
422 result = renderfarm_fs_global->ftell(__stream);
425 renderfarm_fs_global->unlock();
428 if(!done) result = (*func)(__stream);
431 return (*func)(__stream);
435 // Glibc inlines the stat functions and redirects them to __xstat functions
436 int __xstat (int __ver, __const char *__filename,
437 struct stat *__stat_buf)
439 static int (*func)(int __ver, __const char *__filename,
440 struct stat *__stat_buf) = 0;
442 // This pointer is meaningless except on the server.
446 func = (int(*)(int __ver, __const char *__filename,
447 struct stat *__stat_buf))dlsym(RTLD_NEXT, "__xstat");
450 if(!strncmp(__filename, RENDERFARM_FS_PREFIX, strlen(RENDERFARM_FS_PREFIX)))
452 renderfarm_fs_global->lock();
453 result = renderfarm_fs_global->stat(__filename, __stat_buf);
454 renderfarm_fs_global->unlock();
458 result = (*func)(__ver, __filename, __stat_buf);
464 int __xstat64 (int __ver, __const char *__filename,
465 struct stat64 *__stat_buf)
467 static int (*func)(int __ver, __const char *__restrict __file,
468 struct stat64 *__restrict __buf) = 0;
469 // This pointer is meaningless except on the server.
473 func = (int(*)(int __ver, __const char *__restrict __file,
474 struct stat64 *__restrict __buf))dlsym(RTLD_NEXT, "__xstat64");
477 if(!strncmp(__filename, RENDERFARM_FS_PREFIX, strlen(RENDERFARM_FS_PREFIX)))
479 renderfarm_fs_global->lock();
480 result = renderfarm_fs_global->stat64(__filename, __stat_buf);
481 renderfarm_fs_global->unlock();
484 result = (*func)(__ver, __filename, __stat_buf);
489 char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
491 static char* (*func)(char *__restrict __s, int __n, FILE *__restrict __stream) = 0;
495 func = (char*(*)(char *__restrict __s, int __n, FILE *__restrict __stream))dlsym(RTLD_NEXT, "fgets");
497 if(renderfarm_fs_global)
499 renderfarm_fs_global->lock();
500 if(renderfarm_fs_global->is_open(__stream))
502 result = renderfarm_fs_global->fgets(__s, __n, __stream);
505 renderfarm_fs_global->unlock();
508 if(!done) result = (*func)(__s, __n, __stream);
513 int fscanf (FILE *__restrict __stream,
514 __const char *__restrict __format, ...)
519 va_start(ap, __format);
521 if(renderfarm_fs_global)
523 renderfarm_fs_global->lock();
524 if(renderfarm_fs_global->is_open(__stream))
526 // Since this is currently only used in one place in dcraw, leave it blank.
527 // The future implementation may just read until the next \n and scan the string.
528 result = renderfarm_fs_global->fscanf(__stream, __format, ap);
531 renderfarm_fs_global->unlock();
534 if(!done) result = vfscanf(__stream, __format, ap);
560 RenderFarmFSClient::RenderFarmFSClient(RenderFarmClientThread *client)
562 mutex_lock = new Mutex("RenderFarmFSClient::mutex_lock");
563 this->client = client;
566 RenderFarmFSClient::~RenderFarmFSClient()
569 // Must not access filesystem until we get here
570 renderfarm_fs_global = 0;
573 void RenderFarmFSClient::initialize()
575 renderfarm_fs_global = this;
578 void RenderFarmFSClient::lock()
580 mutex_lock->lock("RenderFarmFSClient::lock");
583 void RenderFarmFSClient::unlock()
585 mutex_lock->unlock();
588 int RenderFarmFSClient::is_open(FILE *ptr)
590 for(int i = 0; i < files.total; i++)
591 if(files.values[i] == ptr) return 1;
595 void RenderFarmFSClient::set_open(FILE *ptr, int64_t pointer)
598 if(sizeof(FILE*) == 4)
599 pointers.append(pointer);
602 void RenderFarmFSClient::unset_open(FILE *ptr, int64_t pointer)
605 if(sizeof(FILE*) == 4)
606 pointers.remove(pointer);
609 int64_t RenderFarmFSClient::get_64(FILE *ptr)
611 if(sizeof(FILE*) == 4)
613 for(int i = 0; i < files.total; i++)
615 if(files.values[i] == ptr)
616 return pointers.values[i];
620 return Units::ptr_to_int64(ptr);
622 printf("RenderFarmFSClient::get_64 file %p not found\n", ptr);
627 FILE* RenderFarmFSClient::fopen(const char *path, const char *mode)
630 printf("RenderFarmFSClient::fopen 1\n");
631 int len = strlen(path) - strlen(RENDERFARM_FS_PREFIX) + strlen(mode) + 2;
632 char *buffer = new char[len];
635 strcpy(buffer, path + strlen(RENDERFARM_FS_PREFIX));
636 strcpy(buffer + strlen(buffer) + 1, mode);
639 client->lock("RenderFarmFSClient::fopen");
640 if(!client->send_request_header(RENDERFARM_FOPEN,
643 if(client->write_socket(buffer, len, RENDERFARM_TIMEOUT) == len)
645 unsigned char data[8];
646 if(client->read_socket((char*)data, 8, RENDERFARM_TIMEOUT) == 8)
648 file_int64 = READ_INT64(data);
649 file = (FILE*)Units::int64_to_ptr(file_int64);
654 if(file) set_open(file, file_int64);
658 printf("RenderFarmFSClient::fopen path=%s mode=%s file=%p\n", path, mode, file);
663 int RenderFarmFSClient::fclose(FILE *file)
666 unsigned char datagram[8];
668 int64_t file_int64 = get_64(file);
669 STORE_INT64(file_int64);
671 client->lock("RenderFarmFSClient::fclose");
672 if(!client->send_request_header(RENDERFARM_FCLOSE, 8))
674 if(client->write_socket((char*)datagram, 8, RENDERFARM_TIMEOUT) == 8)
682 unset_open(file, file_int64);
684 printf("RenderFarmFSClient::fclose file=%p\n", file);
688 int RenderFarmFSClient::fileno(FILE *file)
691 printf("RenderFarmFSClient::fileno file=%p\n", file);
693 unsigned char datagram[8];
695 int64_t file_int64 = get_64(file);
696 STORE_INT64(file_int64);
698 client->lock("RenderFarmFSClient::fileno");
699 if(!client->send_request_header(RENDERFARM_FILENO, 8))
701 if(client->write_socket((char*)datagram, 8, RENDERFARM_TIMEOUT) == 8)
703 unsigned char data[4];
704 if(client->read_socket((char*)data, 4, RENDERFARM_TIMEOUT) == 4)
706 result = READ_INT32(data);
716 printf("RenderFarmFSClient::fileno file=%p result=%d\n", file, result);
720 int RenderFarmFSClient::remove (__const char *__filename)
723 int len = strlen(__filename) + 1;
724 char *datagram = new char[len];
725 strcpy(datagram, __filename);
727 client->lock("RenderFarmFSClient::remove");
728 if(!client->send_request_header(RENDERFARM_REMOVE, len))
730 if(client->write_socket(datagram, len, RENDERFARM_TIMEOUT) != len)
741 printf("RenderFarmFSClient::remove path=%s\n", __filename);
745 int RenderFarmFSClient::rename (__const char *__old, __const char *__new)
748 int len = strlen(__old) + 1 + strlen(__new) + 1;
749 char *datagram = new char[len];
750 strcpy(datagram, __old);
751 strcpy(datagram + strlen(__old) + 1, __new);
753 client->lock("RenderFarmFSClient::rename");
754 if(!client->send_request_header(RENDERFARM_RENAME, len))
756 if(client->write_socket(datagram, len, RENDERFARM_TIMEOUT) != len)
767 printf("RenderFarmFSClient::remove old=%s new=%s\n", __old, __new);
771 int RenderFarmFSClient::fgetc (FILE *__stream)
774 printf("RenderFarmFSClient::fgetc 1\n");
776 unsigned char datagram[8];
778 int64_t file_int64 = get_64(__stream);
779 STORE_INT64(file_int64);
781 client->lock("RenderFarmFSClient::fgetc");
782 if(!client->send_request_header(RENDERFARM_FGETC, 8))
784 if(client->write_socket((char*)datagram, 8, RENDERFARM_TIMEOUT) != 8)
788 if(client->read_socket((char*)datagram, 1, RENDERFARM_TIMEOUT) != 1)
792 result = datagram[0];
800 printf("RenderFarmFSClient::fgetc file=%p result=%02x\n", __stream, result);
805 int RenderFarmFSClient::fputc (int __c, FILE *__stream)
808 printf("RenderFarmFSClient::fputc 1\n");
810 unsigned char datagram[9];
812 int64_t file_int64 = get_64(__stream);
813 STORE_INT64(file_int64);
816 client->lock("RenderFarmFSClient::fputc");
817 if(!client->send_request_header(RENDERFARM_FPUTC, 9))
819 if(client->write_socket((char*)datagram, 9, RENDERFARM_TIMEOUT) != 9)
828 printf("RenderFarmFSClient::fputc file=%p result=%02x\n", __stream, result);
833 int RenderFarmFSClient::fscanf(FILE *__restrict stream, const char *__restrict format, va_list ap)
835 char string[BCTEXTLEN];
836 fgets (string, BCTEXTLEN, stream);
840 char* RenderFarmFSClient::fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
844 unsigned char datagram[12];
846 int64_t file_int64 = get_64(__stream);
847 STORE_INT64(file_int64);
850 client->lock("RenderFarmFSClient::fgets");
851 if(!client->send_request_header(RENDERFARM_FGETS, 12))
853 if(client->write_socket((char*)datagram, 12, RENDERFARM_TIMEOUT) == 12)
855 // fgets bytes to follow
856 if(client->read_socket((char*)datagram, 4, RENDERFARM_TIMEOUT) == 4)
859 bytes = READ_INT32(datagram);
862 if(client->read_socket((char*)__s, bytes, RENDERFARM_TIMEOUT) == bytes)
874 printf("RenderFarmFSClient::fgets file=%p string=%p size=%d bytes=%p\n",
875 __stream, __s, bytes, bytes);
881 size_t RenderFarmFSClient::fread (void *__restrict __ptr, size_t __size,
882 size_t __n, FILE *__restrict __stream)
885 unsigned char datagram[16];
887 int64_t file_int64 = get_64(__stream);
888 STORE_INT64(file_int64);
892 client->lock("RenderFarmFSClient::fread");
893 if(!client->send_request_header(RENDERFARM_FREAD, 16))
895 if(client->write_socket((char*)datagram, 16, RENDERFARM_TIMEOUT) != 16)
900 if(client->read_socket((char*)datagram, 4, RENDERFARM_TIMEOUT) != 4)
905 result = READ_INT32(datagram);
906 if(client->read_socket((char*)__ptr, __size * result, RENDERFARM_TIMEOUT) !=
916 printf("RenderFarmFSClient::fread file=%p size=%d num=%d result=%d\n",
917 __stream, __size, __n, result);
922 size_t RenderFarmFSClient::fwrite (__const void *__restrict __ptr, size_t __size,
923 size_t __n, FILE *__restrict __s)
926 printf("RenderFarmFSClient::fwrite 1\n");
928 unsigned char datagram[16];
930 int64_t file_int64 = get_64(__s);
931 STORE_INT64(file_int64);
935 client->lock("RenderFarmFSClient::fwrite");
936 if(!client->send_request_header(RENDERFARM_FWRITE, 16))
938 if(client->write_socket((char*)datagram, 16, RENDERFARM_TIMEOUT) != 16)
943 if(client->write_socket((char*)__ptr, __size * __n, RENDERFARM_TIMEOUT) !=
949 if(client->read_socket((char*)datagram, 4, RENDERFARM_TIMEOUT) != 4)
953 result = READ_INT32(datagram);
962 printf("RenderFarmFSClient::fwrite file=%p size=%d num=%d result=%d\n",
963 __s, __size, __n, result);
968 int RenderFarmFSClient::fseek (FILE *__stream, int64_t __off, int __whence)
971 printf("RenderFarmFSClient::fseek 1\n");
973 unsigned char datagram[20];
975 int64_t file_int64 = get_64(__stream);
976 STORE_INT64(file_int64);
978 STORE_INT32(__whence);
980 // printf("RenderFarmFSClient::fseek %p %llx datagram=%02x%02x%02x%02x%02x%02x%02x%02x\n",
981 // __stream, file_int64, datagram[0], datagram[1], datagram[2], datagram[3], datagram[4], datagram[5], datagram[6], datagram[7]);
982 client->lock("RenderFarmFSClient::fseek");
983 if(!client->send_request_header(RENDERFARM_FSEEK, 20))
985 if(client->write_socket((char*)datagram, 20, RENDERFARM_TIMEOUT) != 20)
989 if(client->read_socket((char*)datagram, 4, RENDERFARM_TIMEOUT) != 4)
992 result = READ_INT32(datagram);
999 printf("RenderFarmFSClient::fseek stream=%p offset=%jd whence=%d result=%d\n",
1000 __stream, __off, __whence, result);
1004 int64_t RenderFarmFSClient::ftell (FILE *__stream)
1007 unsigned char datagram[8];
1009 int64_t file_int64 = get_64(__stream);
1010 STORE_INT64(file_int64);
1012 client->lock("RenderFarmFSClient::ftell");
1013 if(!client->send_request_header(RENDERFARM_FTELL, 8))
1015 if(client->write_socket((char*)datagram, 8, RENDERFARM_TIMEOUT) != 8)
1019 if(client->read_socket((char*)datagram, 8, RENDERFARM_TIMEOUT) != 8)
1022 result = READ_INT64(datagram);
1029 printf("RenderFarmFSClient::fseek stream=%p result=%jd\n",
1034 int RenderFarmFSClient::stat (__const char *__restrict __file,
1035 struct stat *__restrict __buf)
1037 int len = strlen(__file) + 1;
1040 client->lock("RenderFarmFSClient::stat");
1041 if(!client->send_request_header(RENDERFARM_STAT, len))
1043 if(client->write_socket((char*)__file + strlen(RENDERFARM_FS_PREFIX), len, RENDERFARM_TIMEOUT) == len)
1045 if(client->read_socket((char*)__buf, sizeof(struct stat), RENDERFARM_TIMEOUT) == sizeof(struct stat))
1059 printf("RenderFarmFSClient::stat path=%s\n", __file);
1066 int RenderFarmFSClient::stat64 (__const char *__restrict __file,
1067 struct stat64 *__restrict __buf)
1069 int len = strlen(__file) + 1;
1071 bzero(__buf, sizeof(struct stat64));
1073 client->lock("RenderFarmFSClient::stat64");
1074 if(!client->send_request_header(RENDERFARM_STAT64, len))
1076 if(client->write_socket((char*)__file + strlen(RENDERFARM_FS_PREFIX), len, RENDERFARM_TIMEOUT) == len)
1079 if(client->read_socket((char*)&arg, sizeof(arg), RENDERFARM_TIMEOUT) == sizeof(arg))
1081 __buf->st_dev = arg.dev;
1082 // __buf->__st_ino = arg.ino32;
1083 __buf->st_ino = arg.ino;
1084 __buf->st_mode = arg.mode;
1085 __buf->st_nlink = arg.nlink;
1086 __buf->st_uid = arg.uid;
1087 __buf->st_gid = arg.gid;
1088 __buf->st_rdev = arg.rdev;
1089 __buf->st_size = arg.size;
1090 __buf->st_blksize = arg.blksize;
1091 __buf->st_blocks = arg.blocks;
1092 __buf->st_atim.tv_sec = arg.atim;
1093 __buf->st_mtim.tv_sec = arg.mtim;
1094 __buf->st_ctim.tv_sec = arg.ctim;
1106 printf("RenderFarmFSClient::stat64 path=%s\n", __file);