code mount in c language


 
Thread Tools Search this Thread
Top Forums Programming code mount in c language
# 8  
Old 03-23-2006
HI All:
i am back and find the way to use that,
as following is my code but not all
may be you can try it.

#include <sys/param.h>
#include <sys/mount.h>
#include <errno.h>
#include <string.h>
#include <sys/uio.h>
int main()
{
const char cTestPrag[]="/data/test/Test";
int flag;
mount(need to be mounted,"point mount path,flag,"MNT_RDONLY");

//varible flag you can omit but you will get a waring "have no catch ......"

printf("%s",strerror(errno));
return 0;
}

i think use system() to execute mount. maybe use shell than c.
the unix 95 % use c code to write if you want to be a expert onto
c that i think it is necessary.

thanks All
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question
MOUNT.NFS(8)						      System Manager's Manual						      MOUNT.NFS(8)

NAME
mount.nfs, mount.nfs4 - mount a Network File System SYNOPSIS
mount.nfs remotetarget dir [-rvVwfnsh ] [-o options] DESCRIPTION
mount.nfs is a part of nfs(5) utilities package, which provides NFS client functionality. mount.nfs is meant to be used by the mount(8) command for mounting NFS shares. This subcommand, however, can also be used as a standalone command with limited functionality. remotetarget is a server share usually in the form of servername:/path/to/share. dir is the directory on which the file system is to be mounted. Under Linux 2.6.32 and later kernel versions, mount.nfs can mount all NFS file system versions. Under earlier Linux kernel versions, mount.nfs4 must be used for mounting NFSv4 file systems while mount.nfs must be used for NFSv3 and v2. OPTIONS
-r Mount file system readonly. -v Be verbose. -V Print version. -w Mount file system read-write. -f Fake mount. Don't actually call the mount system call. -n Do not update /etc/mtab. By default, an entry is created in /etc/mtab for every mounted file system. Use this option to skip making an entry. -s Tolerate sloppy mount options rather than fail. -h Print help message. nfsoptions Refer to nfs(5) or mount(8) manual pages. NOTE
For further information please refer nfs(5) and mount(8) manual pages. FILES
/etc/fstab file system table /etc/mtab table of mounted file systems SEE ALSO
nfs(5), mount(8), AUTHOR
Amit Gud <agud@redhat.com> 5 Jun 2006 MOUNT.NFS(8)