Hi,
I am trying to set up a cron job for every Friday at 6:00 p.m. and got an error:
"/var/tmp/aaaa29638" 1 line, 73 characters
00 18 00 0 5 /app/test/backup.ksh
crontab: error on previous line; number out of bounds.
Any ideas?
Thanks! (1 Reply)
Hello, sorry if this has been posted before but i was wondering if there is a way to run a program until a segmentation fault is found.
Currently i'm using a simple shell script which runs my program 100 times, sleeps 1 second because srand(time(0)) is dependent on seconds. Is there a possible... (1 Reply)
We have a Solaris 8 server which users login to via VNC to get a desktop. On that desktop these users use Netscape Communicator 4.9 to access a very important mail account. Unfortunately Netscape has started segfaulting regularly.
Does anyone have any ideas how I can try to find out what point... (1 Reply)
Hello everyone,
I'm writing a program using the id3lib unfortunately I've encountered with memory issue that cause segmentation fault. I tried to rerun and analyze the program with valgrind but it doesn't point me anywhere. I really stuck on this one.
Valgrind output:
==14716== Invalid read of... (2 Replies)
I have a program that allows users to specify the debug log file location and name.
I have tried using the access() and stat() but they both segfault if the drive say (d:\) is invalid. Both seem to be fine if the drive exists.
Could someone please point me in the direction to a function that... (1 Reply)
hello all,
my question is not about How code can be rewritten, i just wanna know even though i am not using read only memory of C (i have declared str) why this function gives me segfault :wall:and the other code executes comfortably though both code uses same pointer arithmetic.
... (4 Replies)
Hi,
I've been trying to filter a file which has several repetitions of lines which looks as follows:
('hello
My name is
jamie
blabla
xyz>>)
Each line has different values in them. I want grep or awk or sed to treat everything within the (' and >>) as one line and then filter for a... (2 Replies)
Another project, another bump in the road and another chance to learn. I've been trying to open gzipped files and parse data from them and hit a snag. I have data in gzips with a place followed by an ip or ip range sort of like this:
Some place:x.x.x.x-x.x.x.x
I was able to modify some code... (6 Replies)
What exactly is the -Warray-bounds option to the GCC compiler supposed to warn about?
the man page states:
~ g++ --version
g++ (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2)
Copyright (C) 2017 Free Software Foundation, Inc.Thank you. (14 Replies)
Discussion started by: milhan
14 Replies
LEARN ABOUT ULTRIX
twalk
tsearch(3) Library Functions Manual tsearch(3)Name
tsearch, tfind, tdelete, twalk - manage binary search trees
Syntax
#include <search.h>
void *tsearch (key, rootp, compar)
void *key;
void **rootp;
int (*compar)( );
void *tfind (key, rootp, compar)
void *key;
void **rootp;
int (*compar)( );
void *tdelete (key, rootp, compar)
void *key;
void **rootp;
int (*compar)( );
void twalk (root, action)
void * root;
void (*action)( );
Description
The subroutine is a binary tree search routine generalized from Knuth (6.2.2) Algorithm T. It returns a pointer into a tree indicating
where a datum may be found. If the datum does not occur, it is added at an appropriate point in the tree. The key points to the datum to
be sought in the tree. The rootp points to a variable that points to the root of the tree. A NULL pointer value for the variable denotes
an empty tree; in this case, the variable will be set to point to the datum at the root of the new tree. The compar is the name of the
comparison function. It is called with two arguments that point to the elements being compared. The function must return an integer less
than, equal to, or greater than zero according as the first argument is to be considered less than, equal to, or greater than the second.
Like will search for a datum in the tree, returning a pointer to it if found. However, if it is not found, will return a NULL pointer.
The arguments for are the same as for
The subroutine deletes a node from a binary search tree. It is generalized from Knuth (6.2.2) algorithm D. The arguments are the same as
for The variable pointed to by rootp will be changed if the deleted node was the root of the tree. The subroutine returns a pointer to the
parent of the deleted node, or a NULL pointer if the node is not found.
The subroutine traverses a binary search tree. The root is the root of the tree to be traversed. (Any node in a tree may be used as the
root for a walk below that node.) The action is the name of a routine to be invoked at each node. This routine is, in turn, called with
three arguments. The first argument is the address of the node being visited. The second argument is a value from an enumeration data
type typedef enum { preorder, postorder, endorder, leaf } VISIT; (defined in the <search.h> header file), depending on whether this is the
first, second or third time that the node has been visited (during a depth-first, left-to-right traversal of the tree), or whether the node
is a leaf. The third argument is the level of the node in the tree, with the root being level zero. The pointers to the key and the root
of the tree should be of type pointer-to-element, and cast to type pointer-to-character.
The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being
compared.
Although declared as type pointer-to-character, the value returned should be cast into type pointer-to-element.
Note that the root argument to is one level of indirection less than the rootp arguments to and
Return Values
A NULL pointer is returned by if there is not enough space available to create a new node.
A NULL pointer is returned by and if rootp is NULL on entry.
If the datum is found, both and return a pointer to it. If not, returns NULL, and returns a pointer to the inserted item.
Restrictions
Results are unpredictable if the calling function alters the pointer to the root.
Diagnostics
A NULL pointer is returned by and if rootp is NULL on entry.
See Alsobsearch(3), hsearch(3), lsearch(3)tsearch(3)