I have written a program which takes a directory as command line arguments and displays all the dir and files in it.
I don't know why I have a problem with the /etc directory.It displays all the directories and files untill it reaches a sub directory called peers which is in /etc/ppp/peers.the... (4 Replies)
ive written my code in C for implementation of a simple lexical analyser using singly linked list hence am making use of dynamic allocation,but when run in linux it gives a segmentation fault is it cause of the malloc function that ive made use of????any suggestions as to what i could do???
thank... (8 Replies)
Hi ,
During execution a backup binary i get following error
"Program error 11 (Segmentation fault), saving core file in '/usr/datatools"
Riyaz (2 Replies)
If I do this.
Assume
struct life
{
char *nolife;
}
struct life **life;
// malloc initialization & everything
if(life->nolife == 0)
Would I get error at life->nolife if it is equal to 0.
wrong accession? (3 Replies)
This code is causing a segmentation fault and I can't figure out why. I'm new to UNIX and I need to learn how to avoid this segmentation fault thing. Thank you so much. Thanks also for the great answers to my last post.:):b:
int main()
{
mysqlpp::Connection conn(false);
if... (3 Replies)
i have this code
int already_there(char *client_names, char *username) {
int i;
for(i = 0; i<NUM; i++) {
printf("HERE\n");
if (strcmp(client_names, username)==0) return(1);
}
return(0);
}
and i get a segmentation fault, whats wrong here? (7 Replies)
I use a binary name (ie polo) it gets some parameter , so for debugging normally i do this :
i wrote script for watchdog my app (polo) and check every second if it's not running then start it , the problem is , if my app , remain in state of segmentation fault for a while (ie 15 ... (6 Replies)
I keep getting this fault on a lot of the codes I write, I'm not exactly sure why so I'd really appreciate it if someone could explain the idea to me.
For example this code
#include <stdio.h>
main()
{
unsigned long a=0;
unsigned long b=0;
int z;
{
printf("Enter two... (2 Replies)
Oddities with gcc, 2.95.3 for the AMIGA and 4.2.1 for MY current OSX 10.14.1...
I am creating a basic calculator for the AMIGA ADE *NIX emulator in C as it does not have one.
Below are two very condensed snippets of which I have added the results inside the each code section.
IMPORTANT!... (11 Replies)
Discussion started by: wisecracker
11 Replies
LEARN ABOUT DEBIAN
fec
FEC(3) BSD Library Functions Manual FEC(3)NAME
fec_new, fec_encode, fec_encode, fec_free -- An erasure code in GF(2^m)
SYNOPSIS
#include <fec.h>
void *
fec_new(int k, int n);
void
fec_encode(void *code, void *data[], void *dst, int i, int sz);
int
fec_decode(void *code, void *data[], int i[], int sz);
void *
fec_free(void *code);
DESCRIPTION
This library implements a simple (n,k) erasure code based on Vandermonde matrices. The encoder takes k packets of size sz each, and is able
to produce up to n different encoded packets, numbered from 0 to n-1, such that any subset of k of them permits reconstruction of the origi-
nal data.
The data structures necessary for the encoding/decoding must first be created using calling fec_new() with the desired parameters. The code
descriptor returned by the function must be passed to other functions, and destroyed calling fec_free()
Allowed values for k and n depend on a compile-time value of GF_BITS and must be k <= n <= 2^GF_BITS. Best performance is achieved with
GF_BITS=8, although the code supports also GF_BITS=16.
Encoding is done by calling fec_encode() and passing it pointers to the code descriptor, the source and destination data packets, the index
of the packet to be produced, and the size of the packet.
fec_decode() with pointers to the code, received packets, indexes of received packets, and packet size. Decoding is done in place, possibly
shuffling the arrays passed as parameters. Decoding is deterministic as long as the received packets are different. The decoding procedure
does some limited testing on this and returns if parameters are invalid.
EXAMPLE
#include <fec.h>
/*
* example of sender code
*/
void *code ;
int n, k ;
void *src[] ;
void *pkt ;
code = new_code (k, n );
for (i = 0 ; i < k ; i++ )
src[i] = .. pointer to i-th source packet ..
for (each packet to transmit) {
i = ... index of the packet ;
fec_encode(code, src, pkt, i, size) ;
.. use packet in pkt
}
fec_free(code) ;
/*
* example of receiver code
*/
void *code ;
int n, k ;
void *data[] ;
int *ix[] ;
code = new_code (k, n );
for (i = 0 ; i < k ; i++ ) {
... receive a new packet ...
data[i] = .. pointer to i-th source packet ..
ix[i] = .. index of i-th source packet ..
}
fec_decode(code, data, ix, size) ;
/*
* now data[] has pointers to the source packets
*/
Please direct bug reports to luigi@iet.unipi.it .
BSD July 15, 1998 BSD