How can change udp lenght?
Hello.
I have FreeBsd 4.7 and i want to change udp datagramm lenght.
Where it can be? What i must do? I can rebuild my core but it is not good for me.
Thanks! (4 Replies)
Hi All,
I have a pipe separated flat file.But there is often some problem with the records.So is it possible to convert the '|' separated file into a fixed length file by means of some script.
The file has 11 columns which means 10 pipes.Your help is appreciated.
i'm using Sun OS Version... (2 Replies)
I am facing a strange error while creating posix threads:
Given below are two snippets of code, the first one works whereas the second one gives a garbage value in the output.
Snippet 1
This works:
--------------
int *threadids;
threadids = (int *) malloc (num_threads * sizeof(int));
... (4 Replies)
I'm not familiar with find.
If i use find in a certain directory i want it to show based on hierarchy.
find . type d
fol1
fol1/subfol1
fol1/subfol1/subfol1
fol2
fol2/subfol2
i want it to show like this
fol1/subfol1/subfol1
fol1/subfol1
fol1
fol2/subfol2
fol2
do i need to use... (5 Replies)
Hi
I want to know the maximum length of user name under NIS? I tried googling but it didnt help :(. If there is any command to find out this please let me know. I know on unix user name should be 8 characters long but just i want to know if i can have 9 letter user under mapped under NIS. (1 Reply)
Using the KSH, write a shell script called display_by_length, which takes an absolute pathname to a directory and displays all ordinary files in the directory ordered by their length; for each file listed, display the name of the file and its length - nothing else. Extend this script to take an... (1 Reply)
I made menu script for users so they can run other script without going in shell just from menu.
But i must control their input.
These are criteria:
Input must have 4 signs
First two signs are always lower case letters
Input shall not have some special signs just letters and numbers
... (1 Reply)
actually i am trying to find the lenght of fixed width file record reading from teradata db but its not working can u guys help me out?
code which i wrote---
colmn_lngth=`cat $RPT_FILE | awk -F~ '{print $1}'`
rm $RPT_FILE
while read line
do
result=`echo $line | wc -m`
... (4 Replies)
Trying to do some control flow parsing based on the index postion of an array member. Here is the pseudo code I am trying to write in (preferably in pure bash) where possible. I am thinking regex with do the trick, but need a little help.
pesudo code
if == ENDSINFIVEINTS ]]; then
do... (4 Replies)
Discussion started by: briandanielz
4 Replies
LEARN ABOUT LINUX
insque
INSQUE(3) Linux Programmer's Manual INSQUE(3)NAME
insque, remque - insert/remove an item from a queue
SYNOPSIS
#include <search.h>
void insque(void *elem, void *prev);
void remque(void *elem);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
insque(), remque():
_SVID_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
DESCRIPTION
The insque() and remque() functions manipulate doubly-linked lists. Each element in the list is a structure of which the first two ele-
ments are a forward and a backward pointer. The linked list may be linear (i.e., NULL forward pointer at the end of the list and NULL
backward pointer at the start of the list) or circular.
The insque() function inserts the element pointed to by elem immediately after the element pointed to by prev.
If the list is linear, then the call insque(elem, NULL) can be used to insert the initial list element, and the call sets the forward and
backward pointers of elem to NULL.
If the list is circular, the caller should ensure that the forward and backward pointers of the first element are initialized to point to
that element, and the prev argument of the insque() call should also point to the element.
The remque() function removes the element pointed to by elem from the doubly-linked list.
CONFORMING TO
POSIX.1-2001.
NOTES
Traditionally (e.g., SunOS, Linux libc 4 and libc 5), the arguments of these functions were of type struct qelem *, defined as:
struct qelem {
struct qelem *q_forw;
struct qelem *q_back;
char q_data[1];
};
This is still what you will get if _GNU_SOURCE is defined before including <search.h>.
The location of the prototypes for these functions differs among several versions of Unix. The above is the POSIX version. Some systems
place them in <string.h>. Linux libc4 and libc 5 placed them in <stdlib.h>.
BUGS
In glibc 2.4 and earlier, it was not possible to specify prev as NULL. Consequently, to build a linear list, the caller had to build a
list using an initial call that contained the first two elements of the list, with the forward and backward pointers in each element suit-
ably initialized.
EXAMPLE
The program below demonstrates the use of insque(). Here is an example run of the program:
$ ./a.out -c a b c
Traversing completed list:
a
b
c
That was a circular list
Program source
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <search.h>
struct element {
struct element *forward;
struct element *backward;
char *name;
};
static struct element *
new_element(void)
{
struct element *e;
e = malloc(sizeof(struct element));
if (e == NULL) {
fprintf(stderr, "malloc() failed
");
exit(EXIT_FAILURE);
}
return e;
}
int
main(int argc, char *argv[])
{
struct element *first, *elem, *prev;
int circular, opt, errfnd;
/* The "-c" command-line option can be used to specify that the
list is circular */
errfnd = 0;
circular = 0;
while ((opt = getopt(argc, argv, "c")) != -1) {
switch (opt) {
case 'c':
circular = 1;
break;
default:
errfnd = 1;
break;
}
}
if (errfnd || optind >= argc) {
fprintf(stderr, "Usage: %s [-c] string...
", argv[0]);
exit(EXIT_FAILURE);
}
/* Create first element and place it in the linked list */
elem = new_element();
first = elem;
elem->name = argv[optind];
if (circular) {
elem->forward = elem;
elem->backward = elem;
insque(elem, elem);
} else {
insque(elem, NULL);
}
/* Add remaining command-line arguments as list elements */
while (++optind < argc) {
prev = elem;
elem = new_element();
elem->name = argv[optind];
insque(elem, prev);
}
/* Traverse the list from the start, printing element names */
printf("Traversing completed list:
");
elem = first;
do {
printf(" %s
", elem->name);
elem = elem->forward;
} while (elem != NULL && elem != first);
if (elem == first)
printf("That was a circular list
");
exit(EXIT_SUCCESS);
}
COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2010-09-09 INSQUE(3)