10 More Discussions You Might Find Interesting
1. Programming
I have many headers with huge amount of structures in them, typical one looks like this:
$ cat a.h
struct Rec1 {
int f1;
int f2;
};
struct Rec2 {
char r1;
char r2;
};
struct Rec3 {
int f1;
float k1;
float ... (6 Replies)
Discussion started by: migurus
6 Replies
2. Programming
Hi,
I have received an application that stores some properties in a file. The existing struct looks like this:
struct TData
{
UINT uSizeIncludingStrings;
// copy of Telnet data struct
UINT uSize;
// basic properties:
TCHAR szHost; //defined in Sshconfig
UINT iPortNr;
TCHAR... (2 Replies)
Discussion started by: Powerponken
2 Replies
3. Shell Programming and Scripting
Hey Guys,
I need your help where I have a C structure and I want it to be converted into corresponding function.
Example:
typedef struct
{
unsigned long LineNum; //1025-4032
unsigned short KeyNum; /*tbd*/
char Key; /*between 1-3*/... (1 Reply)
Discussion started by: skyos
1 Replies
4. Programming
in C i am using this code to get the c time or a time or m time
struct dirent *dir;
struct stat my;
stat(what, &my);
thetime = my.st_ctime;
How can i check if i have permission to check the c time of the file? (1 Reply)
Discussion started by: omega666
1 Replies
5. UNIX for Dummies Questions & Answers
Can someone tell me how to do this?
Just a thought that entered my mind when learning about structs.
First thought was:
struct one
{
struct two;
}
struct two
{
three;
}
one->two->three
would this be how you would access "three"? (1 Reply)
Discussion started by: unbelievable21
1 Replies
6. Linux
Hi,
I am working on gcov.Meaning, analysing the functionality of gcov. There is one structure called "struct bb". I am not sure, how struct bb members are getting assigned values. If anyone knows how it is happening pls let me know.
Thanks in advance.
--Vichu (0 Replies)
Discussion started by: Vichu
0 Replies
7. Programming
in my .c file i have a struct atop of the program defined as follows:
#define MAX 10
int curtab;
static struct tab {
int count;
int use;
} tab;
with the initial function following it like so:
int tab_create(int init_count)
{
int i;
for(i=0; i < MAX; i++)
{... (1 Reply)
Discussion started by: micmac700
1 Replies
8. Programming
I receive an integer as argument for a function.
within function definition i want it to be of type struct tm.
eg..
main()
{
int a;
......
}
function(...,..,a,..)
int a;
{
struct tm tm;
if(!a)
^ time(&a);
^ ... (4 Replies)
Discussion started by: bankpro
4 Replies
9. Programming
hi all ,
can i save a structure in c in a file? how ?
help me , thx. :) (2 Replies)
Discussion started by: kall_ANSI
2 Replies
10. Programming
Hi
We are using a code generator for initializing structures with the #define macro. Compiling it with the GCC 2.8.1 (with -ansi) it OK. But when we are using the SUN C 5.0 compiler it screams.
Following is a code sample:
#include <stdlib.h>
#include <stdio.h>
typedef struct TEST3 {... (4 Replies)
Discussion started by: amatsaka
4 Replies
LEARN ABOUT MOJAVE
login_tty
OPENPTY(3) BSD Library Functions Manual OPENPTY(3)
NAME
openpty, login_tty, forkpty -- tty utility functions
SYNOPSIS
#include <util.h>
int
openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp);
int
login_tty(int fd);
pid_t
forkpty(int *amaster, char *name, struct termios *termp, struct winsize *winp);
DESCRIPTION
The openpty(), login_tty(), and forkpty() functions perform manipulations on ttys and pseudo-ttys.
The openpty() function allocates a pseudo-tty and returns file descriptors for the master and slave in amaster and aslave. If name is non-
null, the filename of the slave is returned in name. If termp is non-null, the terminal parameters of the slave will be set to the values in
termp. If winp is non-null, the window size of the slave will be set to the values in winp.
The login_tty() function prepares for a login on the tty fd (which may be a real tty device, or the slave of a pseudo-tty as returned by
openpty()) by creating a new session, making fd the controlling terminal for the current process, setting fd to be the standard input, out-
put, and error streams of the current process, and closing fd.
The forkpty() function combines openpty(), fork(), and login_tty() to creates a new process operating in a pseudo-tty. The file descriptor
of the master side of the pseudo-tty is returned in amaster, and the filename of the slave in name if it is non-null. The termp and winp
parameters, if non-null, will determine the terminal attributes and window size of the slave side of the pseudo-tty.
RETURN VALUES
If a call to openpty(), login_tty(), or forkpty() is not successful, -1 is returned and errno is set to indicate the error. Otherwise,
openpty(), login_tty(), and the child process of forkpty() return 0, and the parent process of forkpty() returns the process ID of the child
process.
ERRORS
openpty() will fail if:
[EAGAIN] There are no available pseudo-ttys.
login_tty() will fail if ioctl() fails to set fd to the controlling terminal of the current process. forkpty() will fail if either openpty()
or fork() fails.
FILES
/dev/ptmx cloning pseudo-tty device
/dev/ttys[0-9][0-9][0-9] slave pseudo-tty devices
SEE ALSO
fork(2)
BSD
April 5, 2008 BSD