Sponsored Content
Full Discussion: code mount in c language
Top Forums Programming code mount in c language Post 102261 by jeter on Thursday 16th of March 2006 05:51:40 PM
Old 03-16-2006
Hi All:
I am coming here again ,i have viewed doucment and write a code as following. but the program con not runs, I have tryed login super user.
thanks Smilie

#include <sys/param.h>
#include <sys/mount.h>
#include <errno.h>
#include <string.h>
int main()
{

const char path[]="data/test/my";
const char Workstationpath[]="/export/home/data/testpgm/"; // a location computer

int flag;

if ((flag = mount(Workstationpath,path,"MNT_RDONLY")))
printf("message %s",strerror(errno));

return 0;
}
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to mount a hotswap scsi drive on a solaris 2.6 netra box using the mount command?

Hi... question is this: How do I mount an LVD hotswap scsi drive in bay #2 on a netra using the mount command? volmgt doesn't seem to mount it and/or I don't know how to view the drives data if it's formatted which it may not be. This drive is not new out of the box so I'm not sure. ... (4 Replies)
Discussion started by: soulshaker
4 Replies

2. UNIX for Dummies Questions & Answers

how does unix identify C and other language code!

Hello everyone, this question is probably simple for you ppl but i am jus a beginner and still learing. i was wondering if someone could tell me that how does unix identify different program codes in it's environment. for example, unix recognises this C code in the body of any script. how... (2 Replies)
Discussion started by: a25khan
2 Replies

3. UNIX for Dummies Questions & Answers

mount -o llock -F nfs vs mount -F nfs

Hi, We encountered NFS issue (solaris) especially running on Oracle application. Problem such as forms hang when close button is click, concurrent job shows running status all time. Understand we need to use mount -o llock -F nfs instead of mount -F nfs to eliminate? this problem.. Can... (1 Reply)
Discussion started by: KhawHL
1 Replies

4. Programming

which language will be the best

Hello, Ive got to amke a script to calculate how many emails are in the servers mailbox, how many times each IP address appears in the mailbox and to search for keywords, tehn produce the results in HTML report. The thing is I dont know where to start and what the best language to use would be. ... (4 Replies)
Discussion started by: clueless
4 Replies

5. UNIX for Dummies Questions & Answers

What language is this?

Hi, Just got handed this script set def = HLA_DR.pockets set data = DRB1_1501.dat foreach a ( 'cat $data | args 3 |sort -u' ) cat $def | xC | grep -v $a > $$.def cat $data | grep $a | args 1,2 > $a.dat set pseudo = `cat MHCDR_pseudo.dat | grep HLA | grep $a | args 2`... (8 Replies)
Discussion started by: lost
8 Replies

6. UNIX for Advanced & Expert Users

mount -t cifs permission denied by mount -t smbfs works fine

I am having trouble mounting with cifs, but mounting the exact same command with smbfs works fine. The share is on another samba server and is set to full public guest access. # mount -t cifs //servername/sharename /mnt/temp -o password="" mount error 13 = Permission denied Refer to the... (3 Replies)
Discussion started by: humbletech99
3 Replies

7. IP Networking

Can't see home folder on one NFS mount but can in another mount on another share

Hello, I have a few Ubuntu 9.10 laptops I'm trying to learn NFS sharing with. I am just experimenting on this right now, so no harsh words about the security of what I'm playing with, please ;) Below are the configs /etc/exports on host /home/woodnt/Homeschool... (2 Replies)
Discussion started by: Narnie
2 Replies

8. Programming

Mount from C code with --no-mtab?

Hi all, I am writing a mount/umount procedure for CD rom and getting into the problem that /etc/mtab is not in sync with /proc/mounts. Then I am ending up with a bunch of dangling /etc/mtab entries that are not valid anymore. Reading through mount(8) I see a -n switch (--no-mtab) which would... (2 Replies)
Discussion started by: mirni
2 Replies

9. Shell Programming and Scripting

Script to mount nas-share using generated credentials (mount EC 13,32)

Heyas At home i have 1 nas with 3 shares, of which i used to mount 2 of them using a script with hardcoded password and username in it. EDIT: Turns out, its not the script, but 'how i access' the nas share.. (-o user=XY,password=... VS. -o credentials=...). Figured about credential files,... (0 Replies)
Discussion started by: sea
0 Replies

10. UNIX for Beginners Questions & Answers

How to create a new mount point with 600GB and add 350 GBexisting mount point? IN AIX

How to create a new mount point with 600GB and add 350 GBexisting mount point Best if there step that i can follow or execute before i mount or add diskspace IN AIX Thanks (2 Replies)
Discussion started by: Thilagarajan
2 Replies
KERNEL_MOUNT(9) 					   BSD Kernel Developer's Manual					   KERNEL_MOUNT(9)

NAME
free_mntarg, kernel_mount, kernel_vmount, mount_arg, mount_argb, mount_argf, mount_argsu -- functions provided as part of the kernel mount interface SYNOPSIS
void free_mntarg(struct mntarg *ma); int kernel_mount(struct mntarg *ma, int flags); int kernel_vmount(int flags, ...); struct mntarg * mount_arg(struct mntarg *ma, const char *name, const void *val, int len); struct mntarg * mount_argb(struct mntarg *ma, int flag, const char *name); struct mntarg * mount_argf(struct mntarg *ma, const char *name, const char *fmt, ...); struct mntarg * mount_argsu(struct mntarg *ma, const char *name, const void *val, int len); DESCRIPTION
The kernel_mount() family of functions are provided as an API for building a list of mount arguments which will be used to mount file systems from inside the kernel. By accumulating a list of arguments, the API takes shape and provides the information necessary for the kernel to control the mount(8) utility. When an error occurs, the process will stop. This will not cause a panic(9). The header of the structure is stored in src/sys/kern/vfs_mount.c which permits automatic structure creation to ease the mount process. Mem- ory allocation must always be freed when the entire process is complete, it is an error otherwise. The free_mntarg() function is used to free or clear the mntarg structure. The kernel_mount() function pulls information from the structure to perform the mount request on a given file system. Additionally, the kernel_mount() function always calls the free_mntarg() function. If ma contains any error code generated during the construction, that code will be called and the file system mount will not be attempted. The kernel_vmount() is a function similar to printf(9) which is used to mount a file system. The mount_arg() function takes a plain argument and crafts parts of the structure with regards to various mount options. If the length is a value less than 0, strlen(3) is used. This argument will be referenced until either free_mntarg() or kernel_mount() is called. The mount_argb() function is used to add boolean arguments to the structure. The flag is the boolean value and name must start with "no", otherwise a panic will occur. The mount_argf() function adds printf(9) style arguments to the current structure. The mount_argsu() function will add arguments to the structure from a userland string. EXAMPLES
An example of the *_cmount() function: static int msdosfs_cmount(struct mntarg *ma, void *data, int flags, struct thread *td) { struct msdosfs_args args; int error; if (data == NULL) return (EINVAL); error = copyin(data, &args, sizeof(args)); if (error) return (error); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); ma = mount_arg(ma, "export", &args.export, sizeof(args.export)); ma = mount_argf(ma, "uid", "%d", args.uid); ma = mount_argf(ma, "gid", "%d", args.gid); ma = mount_argf(ma, "mask", "%d", args.mask); ma = mount_argf(ma, "dirmask", "%d", args.dirmask); ma = mount_argb(ma, args.flags & MSDOSFSMNT_SHORTNAME, "noshortname"); ma = mount_argb(ma, args.flags & MSDOSFSMNT_LONGNAME, "nolongname"); ma = mount_argb(ma, !(args.flags & MSDOSFSMNT_NOWIN95), "nowin95"); ma = mount_argb(ma, args.flags & MSDOSFSMNT_KICONV, "nokiconv"); ma = mount_argsu(ma, "cs_win", args.cs_win, MAXCSLEN); ma = mount_argsu(ma, "cs_dos", args.cs_dos, MAXCSLEN); ma = mount_argsu(ma, "cs_local", args.cs_local, MAXCSLEN); error = kernel_mount(ma, flags); return (error); } When working with kernel_vmount(), varargs must come in pairs, e.g., {name, value}. error = kernel_vmount( MNT_RDONLY, "fstype", vfsname, "fspath", "/", "from", path, NULL); SEE ALSO
VFS(9), VFS_MOUNT(9) HISTORY
The kernel_mount() family of functions and this manual page first appeared in FreeBSD 6.0. AUTHORS
The kernel_mount() family of functions and API was developed by Poul-Henning Kamp <phk@FreeBSD.org>. This manual page was written by Tom Rhodes <trhodes@FreeBSD.org>. BSD
December 13, 2004 BSD
All times are GMT -4. The time now is 07:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy