#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include "my_termios.h"

int 
setsid(void)
{
  return 0;
}

int 
dup(int old)
{
  /* TO_BE_DONE ! */
  return old;
}

int 
dup2(int oldfd, int newfd)
{
fprintf(stdout, "%s:%d\n", __FILE__, __LINE__);
  return newfd;
}

int
getpwnam()
{
fprintf(stdout, "%s:%d\n", __FILE__, __LINE__);
  return 0;
}

int
geteuid()
{
fprintf(stdout, "%s:%d\n", __FILE__, __LINE__);
  return 0;
}

int
getpass()
{
fprintf(stdout, "%s:%d\n", __FILE__, __LINE__);
  return 0;
}

int
getuid()
{
fprintf(stdout, "%s:%d\n", __FILE__, __LINE__);
  return 0;
}

int
getpwuid()
{
fprintf(stdout, "%s:%d\n", __FILE__, __LINE__);
  return 0;
}

int
tcsetattr()
{
fprintf(stdout, "%s:%d\n", __FILE__, __LINE__);
  return 0;
}

int
tcgetattr(int fd, struct termios *termios_p)
{
  memset(termios_p, 0, sizeof(struct termios));

  termios_p->c_iflag = 0x4100;
  termios_p->c_oflag = 0x5;
  termios_p->c_cflag = 0xbf;
  termios_p->c_lflag = 0x8a3b;
  termios_p->c_line  = 0x0;
  termios_p->c_ispeed = 0xf;
  termios_p->c_ospeed = 0xf;
  termios_p->c_cc[0] = 0x3;
  termios_p->c_cc[1] = 0x1c;
  termios_p->c_cc[2] = 0x7f;
  termios_p->c_cc[3] = 0x15;
  termios_p->c_cc[4] = 0x4;
  termios_p->c_cc[5] = 0x0;
  termios_p->c_cc[6] = 0x1;
  termios_p->c_cc[7] = 0x0;
  termios_p->c_cc[8] = 0x11;
  termios_p->c_cc[9] = 0x13;
  termios_p->c_cc[10] = 0x1a;
  termios_p->c_cc[11] = 0x0;
  termios_p->c_cc[12] = 0x12;
  termios_p->c_cc[13] = 0xf;
  termios_p->c_cc[14] = 0x17;
  termios_p->c_cc[15] = 0x16;
  termios_p->c_cc[16] = 0x0;
  termios_p->c_cc[17] = 0x0;
  termios_p->c_cc[18] = 0x0;
  termios_p->c_cc[19] = 0x0;
  termios_p->c_cc[20] = 0x0;
  termios_p->c_cc[21] = 0x0;
  termios_p->c_cc[22] = 0x0;
  termios_p->c_cc[23] = 0x0;
  termios_p->c_cc[24] = 0x0;
  termios_p->c_cc[25] = 0x0;
  termios_p->c_cc[26] = 0x0;
  termios_p->c_cc[27] = 0x0;
  termios_p->c_cc[28] = 0x0;
  termios_p->c_cc[29] = 0x0;
  termios_p->c_cc[30] = 0x0;
  termios_p->c_cc[31] = 0x0;

  return 0;
}

struct servent {
  char    *s_name;        /* official service name */
  char    **s_aliases;    /* alias list */
  int     s_port;         /* port number */
  char    *s_proto;       /* protocol to use */
};

struct servent*
getservbyname(char *name, char *proto)
{
fprintf(stdout, "%s:%d\n", __FILE__, __LINE__);
  return 0;
}
