10 More Discussions You Might Find Interesting
1. Programming
I understand that fork create a child but I need very simple example that make child useful....
I mean how will make the program faster anyone explain with code plz
using C plz (2 Replies)
Discussion started by: fwrlfo
2 Replies
2. UNIX for Dummies Questions & Answers
I'm trying to run a simple test on how to use fork(), i'm able to execute the child process first then the parent, but how can I execute parent then child..?
Thanks! (1 Reply)
Discussion started by: l flipboi l
1 Replies
3. Programming
does fork() spawn only the parent process, what if fork() is looped, does it spawn the parent and the child? (4 Replies)
Discussion started by: Peevish
4 Replies
4. Programming
Hi,
I wrote a simple program for understanding the fork command. The code is as below
int main(void)
{
fork(); printf("hi 1 \n");
fork(); printf("hi 2 \n");
fork(); printf("hi 3 \n");
}
I am getting a variation in the number of times the printf is called if i remove the \n from each... (2 Replies)
Discussion started by: xyz123456
2 Replies
5. UNIX for Advanced & Expert Users
Hi,
I wrote a simple program for understanding the fork command. The code is as below
int main(void)
{
fork(); printf("hi 1 \n");
fork(); printf("hi 2 \n");
fork(); printf("hi 3 \n");
}
I am getting a variation in the number of times the printf is called if i remove the \n from each of... (1 Reply)
Discussion started by: xyz123456
1 Replies
6. Programming
hi all
About this code
for (i = 1; i < n; i++)
if ((childpid = fork()) <= 0)
break;
I really can't understand the output .
and the way fork () return the value .
how about the process Id ,the child process Id and the parent ID
in this case
so please answer me soon (5 Replies)
Discussion started by: iwbasts
5 Replies
7. Programming
Hello all.
I'm developing a filetransfer application, which is supposed to work sort of like dcc, with multiple transfers etc. Now i wonder what the best way to manage the transfers is. Should i fork() for each new transfer, hogging loads of memory or use pthreads? Maybe I can use select to see... (0 Replies)
Discussion started by: crippe
0 Replies
8. Programming
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#define MAX_COUNT 200
#define BUF_SIZE 100
void main(void)
{
pid_t pid;
int i;
char buf;
fork();
pid = getpid();
for (i = 1; i <= MAX_COUNT; i++) {
sprintf(buf,... (2 Replies)
Discussion started by: MKSRaja
2 Replies
9. Programming
I run this code, actually I want to both processes print the message from "data". But only one does. What happens? Anyone can help?
#include <stdio.h>
main(){
int fd, pid;
char x;
fd = open("data",0); /* open file "data" */
pid = fork();
if(pid != 0){
wait(0);
... (2 Replies)
Discussion started by: Herman
2 Replies
10. UNIX for Dummies Questions & Answers
What is a fork? Why would one create a fork? What are the advantages and disadvantages of using a fork?
Please advise.
Thank You.
Deepali (5 Replies)
Discussion started by: Deepali
5 Replies
gld_stats(9S) Data Structures for Drivers gld_stats(9S)
NAME
gld_stats - Generic LAN Driver statistics data structure
SYNOPSIS
#include <sys/gld.h>
INTERFACE LEVEL
Solaris architecture specific (Solaris DDI).
DESCRIPTION
The Generic LAN Driver (GLD) statistics (gld_stats) structure is used to communicate statistics and state information from a GLD-based
driver to GLD when returning from a driver's gldm_get_stats() routine as discussed in gld(9E) and gld(7D). The members of this structure,
filled in by the GLD-based driver, are used when GLD reports the statistics. In the tables below, the name of the statistics variable
reported by GLD is noted in the comments. See gld(7D) for a more detailed description of the meaning of each statistic.
Drivers can make no assumptions about the length of this structure, which might be different in different releases of Solaris and/or GLD.
Structure members private to GLD, not documented here, should not be set or read by the device specific driver.
STRUCTURE MEMBERS
The following structure members are defined for all media types:
uint64_t glds_speed; /* ifspeed */
uint32_t glds_media; /* media */
uint32_t glds_intr; /* intr */
uint32_t glds_norcvbuf; /* norcvbuf */
uint32_t glds_errrcv; /* ierrors */
uint32_t glds_errxmt; /* oerrors */
uint32_t glds_missed; /* missed */
uint32_t glds_underflow; /* uflo */
uint32_t glds_overflow; /* oflo */
The following structure members are defined for media type DL_ETHER:
uint32_t glds_frame; /* align_errors */
uint32_t glds_crc; /* fcs_errors */
uint32_t glds_duplex; /* duplex */
uint32_t glds_nocarrier; /* carrier_errors */
uint32_t glds_collisions; /* collisions */
uint32_t glds_excoll; /* ex_collisions */
uint32_t glds_xmtlatecoll; /* tx_late_collisions */
uint32_t glds_defer; /* defer_xmts */
uint32_t glds_dot3_first_coll; /* first_collisions */
uint32_t glds_dot3_multi_coll; /* multi_collisions */
uint32_t glds_dot3_sqe_error; /* sqe_errors */
uint32_t glds_dot3_mac_xmt_error; /* macxmt_errors */
uint32_t glds_dot3_mac_rcv_error; /* macrcv_errors */
uint32_t glds_dot3_frame_too_long; /* toolong_errors */
uint32_t glds_short; /* runt_errors */
The following structure members are defined for media type DL_TPR:
uint32_t glds_dot5_line_error /* line_errors */
uint32_t glds_dot5_burst_error /* burst_errors */
uint32_t glds_dot5_signal_loss /* signal_losses */
uint32_t glds_dot5_ace_error /* ace_errors */
uint32_t glds_dot5_internal_error /* internal_errors */
uint32_t glds_dot5_lost_frame_error /* lost_frame_errors */
uint32_t glds_dot5_frame_copied_error /* frame_copied_errors */
uint32_t glds_dot5_token_error /* token_errors */
uint32_t glds_dot5_freq_error /* freq_errors */
Note -
Support for the DL_TPR media type is obsolete and may be removed in a future release of Solaris.
The following structure members are defined for media type DL_FDDI:
uint32_t glds_fddi_mac_error; /* mac_errors */
uint32_t glds_fddi_mac_lost; /* mac_lost_errors */
uint32_t glds_fddi_mac_token; /* mac_tokens */
uint32_t glds_fddi_mac_tvx_expired; /* mac_tvx_expired */
uint32_t glds_fddi_mac_late; /* mac_late */
uint32_t glds_fddi_mac_ring_op; /* mac_ring_ops */
Note - Support for the DL_FDDI media type is obsolete and may be removed in a future release of Solaris.
Most of the above statistics variables are counters denoting the number of times the particular event was observed. Exceptions are:
glds_speed An estimate of the interface's current bandwidth in bits per second. For interfaces that do not vary in bandwidth or for
those where no accurate estimation can be made, this object should contain the nominal bandwidth.
glds_media The type of media (wiring) or connector used by the hardware. Currently supported media names include GLDM_AUI, GLDM_BNC,
GLDM_TP, GLDM_10BT, GLDM_100BT, GLDM_100BTX, GLDM_100BT4, GLDM_RING4, GLDM_RING16, GLDM_FIBER, and GLDM_PHYMII.
GLDM_UNKNOWN can also be specified.
glds_duplex Current duplex state of the interface. Supported values are GLD_DUPLEX_HALF and GLD_DUPLEX_FULL. GLD_DUPLEX_UNKNOWN can
also be specified.
SEE ALSO
gld(7D), gld(9F), gld(9E), gld_mac_info(9S)
Writing Device Drivers
SunOS 5.10 7 Jun 2004 gld_stats(9S)