exit(10);
}
- ret = nfs_mount_sync(nfs, client.server, client.export);
+ ret = nfs_mount(nfs, client.server, client.export);
if (ret != 0) {
printf("Failed to mount nfs share : %s\n", nfs_get_error(nfs));
exit(10);
printf("mounted share successfully\n");
- ret = nfs_stat_sync(nfs, NFSFILE, &st);
+ ret = nfs_stat(nfs, NFSFILE, &st);
if (ret != 0) {
printf("Failed to stat(%s) %s\n", NFSFILE, nfs_get_error(nfs));
exit(10);
printf("Size %d\n", (int)st.st_size);
printf("Inode %04o\n", (int)st.st_ino);
- ret = nfs_open_sync(nfs, NFSFILE, O_RDONLY, &nfsfh);
+ ret = nfs_open(nfs, NFSFILE, O_RDONLY, &nfsfh);
if (ret != 0) {
printf("Failed to open(%s) %s\n", NFSFILE, nfs_get_error(nfs));
exit(10);
}
- ret = nfs_read_sync(nfs, nfsfh, 16, buf);
+ ret = nfs_read(nfs, nfsfh, 16, buf);
if (ret < 0) {
printf("Failed to pread(%s) %s\n", NFSFILE, nfs_get_error(nfs));
exit(10);
printf("%02x ", buf[i]&0xff);
}
printf("\n");
- ret = nfs_read_sync(nfs, nfsfh, 16, buf);
+ ret = nfs_read(nfs, nfsfh, 16, buf);
if (ret < 0) {
printf("Failed to pread(%s) %s\n", NFSFILE, nfs_get_error(nfs));
exit(10);
}
printf("\n");
- ret = (int)nfs_lseek_sync(nfs, nfsfh, 0, SEEK_CUR, &offset);
+ ret = (int)nfs_lseek(nfs, nfsfh, 0, SEEK_CUR, &offset);
if (ret < 0) {
printf("Failed to lseek(%s) %s\n", NFSFILE, nfs_get_error(nfs));
exit(10);
printf("File position is %d\n", (int)offset);
printf("seek to end of file\n");
- ret = (int)nfs_lseek_sync(nfs, nfsfh, 0, SEEK_END, &offset);
+ ret = (int)nfs_lseek(nfs, nfsfh, 0, SEEK_END, &offset);
if (ret < 0) {
printf("Failed to lseek(%s) %s\n", NFSFILE, nfs_get_error(nfs));
exit(10);
}
printf("File position is %d\n", (int)offset);
- ret = nfs_fstat_sync(nfs, nfsfh, &st);
+ ret = nfs_fstat(nfs, nfsfh, &st);
if (ret != 0) {
printf("Failed to stat(%s) %s\n", NFSFILE, nfs_get_error(nfs));
exit(10);
printf("Inode %04o\n", (int)st.st_ino);
- ret = nfs_close_sync(nfs, nfsfh);
+ ret = nfs_close(nfs, nfsfh);
if (ret < 0) {
printf("Failed to close(%s): %s\n", NFSFILE, nfs_get_error(nfs));
exit(10);
}
- ret = nfs_opendir_sync(nfs, NFSDIR, &nfsdir);
+ ret = nfs_opendir(nfs, NFSDIR, &nfsdir);
if (ret != 0) {
printf("Failed to open(%s) %s\n", NFSFILE, nfs_get_error(nfs));
exit(10);
nfs_closedir(nfs, nfsdir);
- ret = nfs_open_sync(nfs, NFSFILEW, O_WRONLY, &nfsfh);
+ ret = nfs_open(nfs, NFSFILEW, O_WRONLY, &nfsfh);
if (ret != 0) {
printf("Failed to open(%s) %s\n", NFSFILEW, nfs_get_error(nfs));
exit(10);
}
- ret = nfs_pwrite_sync(nfs, nfsfh, 0, 16, buf);
+ ret = nfs_pwrite(nfs, nfsfh, 0, 16, buf);
if (ret < 0) {
printf("Failed to pwrite(%s) %s\n", NFSFILEW, nfs_get_error(nfs));
exit(10);
}
- ret = nfs_fsync_sync(nfs, nfsfh);
+ ret = nfs_fsync(nfs, nfsfh);
if (ret < 0) {
printf("Failed to fsync(%s) %s\n", NFSFILEW, nfs_get_error(nfs));
exit(10);
}
- ret = nfs_close_sync(nfs, nfsfh);
+ ret = nfs_close(nfs, nfsfh);
if (ret < 0) {
printf("Failed to close(%s) %s\n", NFSFILEW, nfs_get_error(nfs));
exit(10);
}
- ret = nfs_statvfs_sync(nfs, NFSDIR, &svfs);
+ ret = nfs_statvfs(nfs, NFSDIR, &svfs);
if (ret < 0) {
printf("Failed to statvfs(%s) %s\n", NFSDIR, nfs_get_error(nfs));
exit(10);
printf("files %d/%d/%d\n", (int)svfs.f_files, (int)svfs.f_ffree, (int)svfs.f_favail);
- ret = nfs_access_sync(nfs, NFSFILE, R_OK);
+ ret = nfs_access(nfs, NFSFILE, R_OK);
if (ret != 0) {
printf("Failed to access(%s) %s\n", NFSFILE, nfs_get_error(nfs));
}
/* become root */
nfs_set_auth(nfs, authunix_create("Ronnies-Laptop", 0, 0, 0, NULL));
- ret = nfs_link_sync(nfs, NFSFILE, NFSFILER);
+ ret = nfs_link(nfs, NFSFILE, NFSFILER);
if (ret != 0) {
printf("Failed to link(%s) %s\n", NFSFILE, nfs_get_error(nfs));
}
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_mount_sync(struct nfs_context *nfs, const char *server, const char *exportname);
+int nfs_mount(struct nfs_context *nfs, const char *server, const char *exportname);
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_stat_sync(struct nfs_context *nfs, const char *path, struct stat *st);
+int nfs_stat(struct nfs_context *nfs, const char *path, struct stat *st);
/*
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_fstat_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, struct stat *st);
+int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh, struct stat *st);
* 0 : The operation was successfull. *nfsfh is filled in.
* -errno : The command failed.
*/
-int nfs_open_sync(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh);
+int nfs_open(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh);
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_close_sync(struct nfs_context *nfs, struct nfsfh *nfsfh);
+int nfs_close(struct nfs_context *nfs, struct nfsfh *nfsfh);
/*
* >=0 : numer of bytes read.
* -errno : An error occured.
*/
-int nfs_pread_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, size_t count, char *buf);
+int nfs_pread(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, size_t count, char *buf);
* >=0 : numer of bytes read.
* -errno : An error occured.
*/
-int nfs_read_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, size_t count, char *buf);
+int nfs_read(struct nfs_context *nfs, struct nfsfh *nfsfh, size_t count, char *buf);
* >=0 : numer of bytes written.
* -errno : An error occured.
*/
-int nfs_pwrite_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, size_t count, char *buf);
+int nfs_pwrite(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, size_t count, char *buf);
/*
* >=0 : numer of bytes written.
* -errno : An error occured.
*/
-int nfs_write_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, size_t count, char *buf);
+int nfs_write(struct nfs_context *nfs, struct nfsfh *nfsfh, size_t count, char *buf);
/*
* >=0 : numer of bytes read.
* -errno : An error occured.
*/
-int nfs_lseek_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, int whence, off_t *current_offset);
+int nfs_lseek(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, int whence, off_t *current_offset);
/*
* 0 : Success
* -errno : An error occured.
*/
-int nfs_fsync_sync(struct nfs_context *nfs, struct nfsfh *nfsfh);
+int nfs_fsync(struct nfs_context *nfs, struct nfsfh *nfsfh);
* 0 : Success
* -errno : An error occured.
*/
-int nfs_truncate_sync(struct nfs_context *nfs, const char *path, off_t length);
+int nfs_truncate(struct nfs_context *nfs, const char *path, off_t length);
* 0 : Success
* -errno : An error occured.
*/
-int nfs_ftruncate_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t length);
+int nfs_ftruncate(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t length);
* 0 : Success
* -errno : An error occured.
*/
-int nfs_mkdir_sync(struct nfs_context *nfs, const char *path);
+int nfs_mkdir(struct nfs_context *nfs, const char *path);
* 0 : Success
* -errno : An error occured.
*/
-int nfs_rmdir_sync(struct nfs_context *nfs, const char *path);
+int nfs_rmdir(struct nfs_context *nfs, const char *path);
* 0 : Success
* -errno : An error occured.
*/
-int nfs_creat_sync(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh);
+int nfs_creat(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh);
* 0 : Success
* -errno : An error occured.
*/
-int nfs_unlink_sync(struct nfs_context *nfs, const char *path);
+int nfs_unlink(struct nfs_context *nfs, const char *path);
* 0 : Success
* -errno : An error occured.
*/
-int nfs_opendir_sync(struct nfs_context *nfs, const char *path, struct nfsdir **nfsdir);
+int nfs_opendir(struct nfs_context *nfs, const char *path, struct nfsdir **nfsdir);
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_statvfs_sync(struct nfs_context *nfs, const char *path, struct statvfs *svfs);
+int nfs_statvfs(struct nfs_context *nfs, const char *path, struct statvfs *svfs);
/*
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_readlink_sync(struct nfs_context *nfs, const char *path, char *buf, int bufsize);
+int nfs_readlink(struct nfs_context *nfs, const char *path, char *buf, int bufsize);
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_chmod_sync(struct nfs_context *nfs, const char *path, int mode);
+int nfs_chmod(struct nfs_context *nfs, const char *path, int mode);
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_fchmod_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, int mode);
+int nfs_fchmod(struct nfs_context *nfs, struct nfsfh *nfsfh, int mode);
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_chown_sync(struct nfs_context *nfs, const char *path, int uid, int gid);
+int nfs_chown(struct nfs_context *nfs, const char *path, int uid, int gid);
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_fchown_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, int uid, int gid);
+int nfs_fchown(struct nfs_context *nfs, struct nfsfh *nfsfh, int uid, int gid);
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_utimes_sync(struct nfs_context *nfs, const char *path, struct timeval *times);
+int nfs_utimes(struct nfs_context *nfs, const char *path, struct timeval *times);
/*
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_utime_sync(struct nfs_context *nfs, const char *path, struct utimbuf *times);
+int nfs_utime(struct nfs_context *nfs, const char *path, struct utimbuf *times);
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_access_sync(struct nfs_context *nfs, const char *path, int mode);
+int nfs_access(struct nfs_context *nfs, const char *path, int mode);
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_symlink_sync(struct nfs_context *nfs, const char *oldpath, const char *newpath);
+int nfs_symlink(struct nfs_context *nfs, const char *oldpath, const char *newpath);
/*
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_rename_sync(struct nfs_context *nfs, const char *oldpath, const char *newpath);
+int nfs_rename(struct nfs_context *nfs, const char *oldpath, const char *newpath);
* 0 : The operation was successfull.
* -errno : The command failed.
*/
-int nfs_link_sync(struct nfs_context *nfs, const char *oldpath, const char *newpath);
+int nfs_link(struct nfs_context *nfs, const char *oldpath, const char *newpath);
}
}
-int nfs_mount_sync(struct nfs_context *nfs, const char *server, const char *export)
+int nfs_mount(struct nfs_context *nfs, const char *server, const char *export)
{
struct sync_cb_data cb_data;
memcpy(cb_data->return_data, data, sizeof(struct stat));
}
-int nfs_stat_sync(struct nfs_context *nfs, const char *path, struct stat *st)
+int nfs_stat(struct nfs_context *nfs, const char *path, struct stat *st)
{
struct sync_cb_data cb_data;
*nfsfh = fh;
}
-int nfs_open_sync(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh)
+int nfs_open(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh)
{
struct sync_cb_data cb_data;
memcpy(buffer, (char *)data, status);
}
-int nfs_pread_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, size_t count, char *buffer)
+int nfs_pread(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, size_t count, char *buffer)
{
struct sync_cb_data cb_data;
/*
* read()
*/
-int nfs_read_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, size_t count, char *buffer)
+int nfs_read(struct nfs_context *nfs, struct nfsfh *nfsfh, size_t count, char *buffer)
{
- return nfs_pread_sync(nfs, nfsfh, nfs_get_current_offset(nfsfh), count, buffer);
+ return nfs_pread(nfs, nfsfh, nfs_get_current_offset(nfsfh), count, buffer);
}
/*
}
}
-int nfs_close_sync(struct nfs_context *nfs, struct nfsfh *nfsfh)
+int nfs_close(struct nfs_context *nfs, struct nfsfh *nfsfh)
{
struct sync_cb_data cb_data;
/*
* fstat()
*/
-int nfs_fstat_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, struct stat *st)
+int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh, struct stat *st)
{
struct sync_cb_data cb_data;
}
}
-int nfs_pwrite_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, size_t count, char *buf)
+int nfs_pwrite(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, size_t count, char *buf)
{
struct sync_cb_data cb_data;
/*
* write()
*/
-int nfs_write_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, size_t count, char *buf)
+int nfs_write(struct nfs_context *nfs, struct nfsfh *nfsfh, size_t count, char *buf)
{
- return nfs_pwrite_sync(nfs, nfsfh, nfs_get_current_offset(nfsfh), count, buf);
+ return nfs_pwrite(nfs, nfsfh, nfs_get_current_offset(nfsfh), count, buf);
}
}
}
-int nfs_fsync_sync(struct nfs_context *nfs, struct nfsfh *nfsfh)
+int nfs_fsync(struct nfs_context *nfs, struct nfsfh *nfsfh)
{
struct sync_cb_data cb_data;
}
}
-int nfs_ftruncate_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t length)
+int nfs_ftruncate(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t length)
{
struct sync_cb_data cb_data;
}
}
-int nfs_truncate_sync(struct nfs_context *nfs, const char *path, off_t length)
+int nfs_truncate(struct nfs_context *nfs, const char *path, off_t length)
{
struct sync_cb_data cb_data;
}
}
-int nfs_mkdir_sync(struct nfs_context *nfs, const char *path)
+int nfs_mkdir(struct nfs_context *nfs, const char *path)
{
struct sync_cb_data cb_data;
}
}
-int nfs_rmdir_sync(struct nfs_context *nfs, const char *path)
+int nfs_rmdir(struct nfs_context *nfs, const char *path)
{
struct sync_cb_data cb_data;
*nfsfh = fh;
}
-int nfs_creat_sync(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh)
+int nfs_creat(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh)
{
struct sync_cb_data cb_data;
}
}
-int nfs_unlink_sync(struct nfs_context *nfs, const char *path)
+int nfs_unlink(struct nfs_context *nfs, const char *path)
{
struct sync_cb_data cb_data;
*nfsdir = dir;
}
-int nfs_opendir_sync(struct nfs_context *nfs, const char *path, struct nfsdir **nfsdir)
+int nfs_opendir(struct nfs_context *nfs, const char *path, struct nfsdir **nfsdir)
{
struct sync_cb_data cb_data;
}
}
-int nfs_lseek_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, int whence, off_t *current_offset)
+int nfs_lseek(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, int whence, off_t *current_offset)
{
struct sync_cb_data cb_data;
memcpy(cb_data->return_data, data, sizeof(struct statvfs));
}
-int nfs_statvfs_sync(struct nfs_context *nfs, const char *path, struct statvfs *svfs)
+int nfs_statvfs(struct nfs_context *nfs, const char *path, struct statvfs *svfs)
{
struct sync_cb_data cb_data;
memcpy(cb_data->return_data, data, strlen(data)+1);
}
-int nfs_readlink_sync(struct nfs_context *nfs, const char *path, char *buf, int bufsize)
+int nfs_readlink(struct nfs_context *nfs, const char *path, char *buf, int bufsize)
{
struct sync_cb_data cb_data;
}
}
-int nfs_chmod_sync(struct nfs_context *nfs, const char *path, int mode)
+int nfs_chmod(struct nfs_context *nfs, const char *path, int mode)
{
struct sync_cb_data cb_data;
}
}
-int nfs_fchmod_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, int mode)
+int nfs_fchmod(struct nfs_context *nfs, struct nfsfh *nfsfh, int mode)
{
struct sync_cb_data cb_data;
}
}
-int nfs_chown_sync(struct nfs_context *nfs, const char *path, int uid, int gid)
+int nfs_chown(struct nfs_context *nfs, const char *path, int uid, int gid)
{
struct sync_cb_data cb_data;
}
}
-int nfs_fchown_sync(struct nfs_context *nfs, struct nfsfh *nfsfh, int uid, int gid)
+int nfs_fchown(struct nfs_context *nfs, struct nfsfh *nfsfh, int uid, int gid)
{
struct sync_cb_data cb_data;
}
}
-int nfs_utimes_sync(struct nfs_context *nfs, const char *path, struct timeval *times)
+int nfs_utimes(struct nfs_context *nfs, const char *path, struct timeval *times)
{
struct sync_cb_data cb_data;
}
}
-int nfs_utime_sync(struct nfs_context *nfs, const char *path, struct utimbuf *times)
+int nfs_utime(struct nfs_context *nfs, const char *path, struct utimbuf *times)
{
struct sync_cb_data cb_data;
}
}
-int nfs_access_sync(struct nfs_context *nfs, const char *path, int mode)
+int nfs_access(struct nfs_context *nfs, const char *path, int mode)
{
struct sync_cb_data cb_data;
}
}
-int nfs_symlink_sync(struct nfs_context *nfs, const char *oldpath, const char *newpath)
+int nfs_symlink(struct nfs_context *nfs, const char *oldpath, const char *newpath)
{
struct sync_cb_data cb_data;
}
}
-int nfs_rename_sync(struct nfs_context *nfs, const char *oldpath, const char *newpath)
+int nfs_rename(struct nfs_context *nfs, const char *oldpath, const char *newpath)
{
struct sync_cb_data cb_data;
}
}
-int nfs_link_sync(struct nfs_context *nfs, const char *oldpath, const char *newpath)
+int nfs_link(struct nfs_context *nfs, const char *oldpath, const char *newpath)
{
struct sync_cb_data cb_data;