I am familiar with using "lsof <filename>" or "fuser <filename>" to determine what process has a given file (usually a .nfs) open. However, I recently used this command and it returned a blank list. I suspect the process that has the .nfs file open might be on another system. Is there a way... (2 Replies)
We would be migrating UNIX file system to Linux file system.
We do have many directory and sub directories with files.
after migrating unix to linux file system , i want to make sure all the files has been copied ? What would be the best approach to validate directory ,sub-directory and file... (1 Reply)
hi,
i would like to know how to programatically obtain informations about existing NICs (both configured and non-configured if possible) on *NIX?
i need to write simple *NIX C/C++ program that will have these informations. i have tried to search forums (and also google) with no luck. any help... (2 Replies)
Hi,
I am working on a Unix console.
I want to obtain the Linux distribution details in
1) Shell
2) C program ( System call )
Want to know if it is REDHAT / SUSE / UBUNTU , etc ..
Please let me know if there is any way to achieve this.
Thanks in advance,
Siva. (8 Replies)
Hi, folks,
I have developed CK-ERP, which is an open source accounting / MRP / ERP / CRM system that runs on top of multiple middlewares. It provides accounting and back office functionalities to SMEs and utilizes the underlying middleware to administer accounts/groups.
Details about and... (0 Replies)
Hi i am an fresh engineer working in a Embedding company and i am new to linux so any one help me to teach or tell how to open a WinZip file in linux as i use gunzip but hte file suffix is not gz so can any one healp me...
urs
... (2 Replies)
:confused: Hai guys!!!!
I am using Mandrake Linux 10.1 with Intel P4 system..
I don't know how to open .DAT video file in LINUX.
Please help me! (1 Reply)
dkio(4) Kernel Interfaces Manual dkio(4)Name
dkio - disk interface
Syntax
#include <sys/fs.h>
#include <sys/ioctl.h>
Description
This section describes the ioctl (input/output controller) codes for all disk drivers. The basic ioctl (input/output controller) format
is:
#include <sys/fs.h>
#include <sys/ioctl.h>
ioctl(fildes, code, arg)
struct pt *arg;
The applicable codes are:
DIOCGETPT Indicates to the driver to store the information in the current partition table in the address pointed to by arg. The file
descriptor must be opened on the raw partitions, a or c.
DIOCGETPT does not change the partition table, but it does provide access to the partition table information.
DIOCSETPT Indicates to the driver to modify the current partition table with the information pointed to by arg.
The file descriptor must be opened on the raw partitions, a or c.
If the a or c partition is not mounted, only the partition table in the driver is modified. This temporarily modifies the
partition table of the disk. The modifications are overwritten with the default table when the disk is turned off and on.
If the a or c partition is mounted, both the partition table in the driver and the partition table in the primary
superblock are modified. This permanently modifies the partition table of the disk. This is not recommended. To change a
partition table permanently, use the command.
DIOCDGTPT Indicates to the driver to store the default information of the current partition table in the address pointed to by arg.
The file descriptor must be opened on the raw partitions a or c.
DIOCGETPT does not change the partition table, but it does provide access to the partition table information.
DKIOCGET Allows the user to receive generic disk information as defined in structdevget.
DKIOCACC This code is defined in It is currently unused.
Restrictions
These restrictions apply when using the DIOCSETPT ioctl code:
o You must have superuser privileges.
o You cannot shrink or change the offset of a partition with a file system mounted on it or with an open file descriptor on the entire
partition.
o You cannot change the offset of the a partition.
Examples
This example shows how to use the DIOGETPT ioctl code to print the length and offset of the a partition of an RZ23 disk:
#include <sys/types.h>
#include <sys/param.h>
#include <sys/fs.h>
#include <sys/ioctl.h>
main()
{
struct pt arg;
int fd, i;
/* Open the "a" partition of the disk you want to see */
if ( (fd = open("/dev/rz0a",0)) < 0 ) {
printf("Unable to open device
");
exit(2);
}
/* Get the partition information */
if ( ioctl(fd,DIOCGETPT,&arg) < 0 )
printf("Error in ioctl
");
printf("Length Offset
");
for ( i = 0; i <= 7; i++ ) {
printf("%d %d
",arg.pt_part[i].pi_nblocks,
arg.pt_part[i].pi_blkoff );
}
}
FilesSee Alsorz(4), disktab(5), fstab(5), chpt(8), diskpart(8), fsck(8), MAKEDEV(8), mkfs(8), tunefs(8)
RISC dkio(4)