There is no standard API for returning this information. You need to use the FIONREAD ioctl if it is available on your platform. Typical code would be something like the following.
Hi,
I have a file that has 300 records with a load of fields. two of them are:
field_1 has between 8-9 bytes i.e. 012345678, 0123456789
field_2 has 10 bytes i.e. 01234567890
I want to be able to echo out the total of each of these fields i.e.
200 (have 8 - 9 bytes)
100 (have 10 bytes)... (3 Replies)
Im using the vmstat command to display the CPU run queue, but i want to put that into a program so is there a way to just display the number under the r?
Thanks, (1 Reply)
Hi,
i have following line in my code.
eport.pl < $4 | dos2ux | head -2000 | paste -sd\| - | awk -v S="$1" '
Issue is, i get a message saying "awk:input line | found /file/path cannot be longer than 3000 bytes."
"source line number is 3"
Can someone help me with this please? (4 Replies)
Hi,
Currently we are experiencing qdaemon died, hourly.
We have more than 10,000 print queue on AIX 5.3.
Would this cause the qdaemon to die?
What is the maximum number of print queue on AIX 5.3?
Thank you in advance. (0 Replies)
1) I need a shell code to count the number of files ( without directories or sub-directories ) in a directory given as arguments I tried this code but it didn't work , maybe I tried the wrong one:
numOfFiles=`find $1 -type f -maxdepth 1 | wc -l`
I found it in another thread in this site..
... (17 Replies)
Guys,
I want to get the high CPU utilization from top.
I am using below code :
top -d2 >> /home/dba_monitoring/host_top_output.txt
echo "Script started `date`" > $runlog
usage=`grep "^ *$1" /home/dba_monitoring/host_top_output.txt | awk '{print $12}' | sed 's/%//'`
And getting below... (7 Replies)
Hi,
I am using the libxml2 sax parser to parse a in memory xml string along with validating it against a schema.
I am using the following code:
xmlSAXHandlerPtr sax_ = new xmlSAXHandler();
sax_->initialized = XML_SAX2_MAGIC;
sax_->startElementNs =... (0 Replies)
I am writing a bash script to find out all the files in a directory which are empty. I am running into multiple issues. I will really appreciate if someone can please help me.
#!/bin/bash
DATE=$(date +%m%d%y)
TIME=$(date +%H%M)
DIR="/home/statsetl/input/civil/test"
... (1 Reply)
Hello guys. I really hope someone will help me with this one..
So, I have to write this script who:
- creates a file home/student/vmdisk of 10 mb
- formats that file to ext3
- mounts that partition to /mnt/partition
- creates a file /mnt/partition/data. In this file, there will... (1 Reply)
hello,
suppose, entered input is of 1-40 bytes, i need it to be converted to 40 bytes exactly.
example: if i have entered my name anywhere between 1-40 i want it to be stored with 40 bytes exactly.
enter your name:
donald duck (this is of 11 bytes)
expected is as below - display 11... (3 Replies)
Discussion started by: shravan.300
3 Replies
LEARN ABOUT MINIX
ioctl
IOCTL(2) System Calls Manual IOCTL(2)NAME
ioctl - control device
SYNOPSIS
#include <sys/types.h>
#include <sys/ioctl.h>
int ioctl(int d, int request, void *argp) (Minix)
int ioctl(int d, ioreq_t request, void *argp) (Minix-vmd)
DESCRIPTION
Ioctl performs a variety of functions on open descriptors. In particular, many operating characteristics of character special files (e.g.
terminals) may be controlled with ioctl requests. The writeups of various devices in section 4 discuss how ioctl applies to them.
An ioctl request has encoded in it whether the argument is an "in" parameter or "out" parameter, and the size of the argument argp in
bytes. Macros and defines used in specifying an ioctl request are located in the file <sys/ioctl.h>.
RETURN VALUE
If an error has occurred, a value of -1 is returned and errno is set to indicate the error.
ERRORS
Ioctl will fail if one or more of the following are true:
[EBADF] D is not a valid descriptor.
[ENOTTY] D is not associated with a character special device.
[ENOTTY] The specified request does not apply to the kind of object that the descriptor d references.
[EINVAL] Request or argp is not valid.
SEE ALSO execve(2), fcntl(2), mt(4), tty(4), intro(4).
4th Berkeley Distribution March 4, 1986 IOCTL(2)