Changeset 567cce1 in rtems-libbsd


Ignore:
Timestamp:
May 4, 2017, 12:27:57 PM (2 years ago)
Author:
Kevin Kirspel <kevin-kirspel@…>
Branches:
fd86c091b97759106da7355ce1dd81ebe030e285, f020f08430150c1656a0ad0a1de13699db9b980b
Children:
4a8f953
Parents:
f6c52e0
git-author:
Kevin Kirspel <kevin-kirspel@…> (05/04/17 12:27:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/11/17 09:15:41)
Message:

Updating STTY command for use in RTEMS shell

Location:
freebsd/bin/stty
Files:
9 added
7 edited

Legend:

Unmodified
Added
Removed
  • freebsd/bin/stty/cchar.c

    rf6c52e0 r567cce1  
    11#include <machine/rtems-bsd-user-space.h>
    22
     3#ifdef __rtems__
     4#include "rtems-bsd-stty-namespace.h"
     5#endif /* __rtems__ */
    36/*-
    47 * Copyright (c) 1991, 1993, 1994
     
    3841__FBSDID("$FreeBSD$");
    3942
     43#ifdef __rtems__
     44#include <machine/rtems-bsd-program.h>
     45#endif /* __rtems__ */
    4046#include <sys/types.h>
    4147
     
    4854#include "stty.h"
    4955#include "extern.h"
     56#ifdef __rtems__
     57#include "rtems-bsd-stty-cchar-data.h"
     58#endif /* __rtems__ */
    5059
    5160static int c_cchar(const void *, const void *);
  • freebsd/bin/stty/gfmt.c

    rf6c52e0 r567cce1  
    11#include <machine/rtems-bsd-user-space.h>
    22
     3#ifdef __rtems__
     4#include "rtems-bsd-stty-namespace.h"
     5#endif /* __rtems__ */
    36/*-
    47 * Copyright (c) 1991, 1993, 1994
     
    3841__FBSDID("$FreeBSD$");
    3942
     43#ifdef __rtems__
     44#include <machine/rtems-bsd-program.h>
     45#endif /* __rtems__ */
    4046#include <sys/types.h>
    4147
  • freebsd/bin/stty/key.c

    rf6c52e0 r567cce1  
    11#include <machine/rtems-bsd-user-space.h>
    22
     3#ifdef __rtems__
     4#include "rtems-bsd-stty-namespace.h"
     5#endif /* __rtems__ */
    36/*-
    47 * Copyright (c) 1991, 1993, 1994
     
    3841__FBSDID("$FreeBSD$");
    3942
     43#ifdef __rtems__
     44#include <machine/rtems-bsd-program.h>
     45#endif /* __rtems__ */
    4046#include <sys/types.h>
    4147
     
    97103        { "tty",        f_tty,          0 },
    98104};
     105#ifdef __rtems__
     106#include "rtems-bsd-stty-key-data.h"
     107#endif /* __rtems__ */
    99108
    100109static int
  • freebsd/bin/stty/modes.c

    rf6c52e0 r567cce1  
    11#include <machine/rtems-bsd-user-space.h>
    22
     3#ifdef __rtems__
     4#include "rtems-bsd-stty-namespace.h"
     5#endif /* __rtems__ */
    36/*-
    47 * Copyright (c) 1991, 1993, 1994
     
    3841__FBSDID("$FreeBSD$");
    3942
     43#ifdef __rtems__
     44#include <machine/rtems-bsd-program.h>
     45#endif /* __rtems__ */
    4046#include <sys/types.h>
    4147#include <stddef.h>
    4248#include <string.h>
    4349#include "stty.h"
     50#ifdef __rtems__
     51#include "rtems-bsd-stty-modes-data.h"
     52#endif /* __rtems__ */
    4453
    4554int msearch(char ***, struct info *);
  • freebsd/bin/stty/print.c

    rf6c52e0 r567cce1  
    11#include <machine/rtems-bsd-user-space.h>
    22
     3#ifdef __rtems__
     4#include "rtems-bsd-stty-namespace.h"
     5#endif /* __rtems__ */
    36/*-
    47 * Copyright (c) 1991, 1993, 1994
     
    3841__FBSDID("$FreeBSD$");
    3942
     43#ifdef __rtems__
     44#include <machine/rtems-bsd-program.h>
     45#endif /* __rtems__ */
    4046#include <sys/types.h>
    4147
     
    4652#include "stty.h"
    4753#include "extern.h"
     54#ifdef __rtems__
     55#include "rtems-bsd-stty-print-data.h"
     56#endif /* __rtems__ */
    4857
    4958static void  binit(const char *);
  • freebsd/bin/stty/stty.c

    rf6c52e0 r567cce1  
    11#include <machine/rtems-bsd-user-space.h>
    22
     3#ifdef __rtems__
     4#include "rtems-bsd-stty-namespace.h"
     5#endif /* __rtems__ */
    36/*-
    47 * Copyright (c) 1989, 1991, 1993, 1994
     
    4447__FBSDID("$FreeBSD$");
    4548
     49#ifdef __rtems__
     50#define __need_getopt_newlib
     51#include <getopt.h>
     52#include <machine/rtems-bsd-program.h>
     53#include <machine/rtems-bsd-commands.h>
     54#endif /* __rtems__ */
    4655#include <sys/types.h>
    4756
     
    5867#include "stty.h"
    5968#include "extern.h"
    60 
     69#ifdef __rtems__
     70#include "rtems-bsd-stty-stty-data.h"
     71#endif /* __rtems__ */
     72
     73#ifdef __rtems__
     74static int main(int argc, char *argv[]);
     75
     76RTEMS_LINKER_RWSET(bsd_prog_stty, char);
     77
     78int
     79rtems_bsd_command_stty(int argc, char *argv[])
     80{
     81  int exit_code;
     82  void *data_begin;
     83  size_t data_size;
     84
     85  data_begin = RTEMS_LINKER_SET_BEGIN(bsd_prog_stty);
     86  data_size = RTEMS_LINKER_SET_SIZE(bsd_prog_stty);
     87
     88  rtems_bsd_program_lock();
     89  exit_code = rtems_bsd_program_call_main_with_data_restore("stty",
     90      main, argc, argv, data_begin, data_size);
     91  rtems_bsd_program_unlock();
     92
     93  return exit_code;
     94}
     95#endif /* __rtems__ */
    6196int
    6297main(int argc, char *argv[])
     
    66101        int ch;
    67102        const char *file, *errstr = NULL;
     103#ifdef __rtems__
     104        struct getopt_data getopt_data;
     105        memset(&getopt_data, 0, sizeof(getopt_data));
     106#define optind getopt_data.optind
     107#define optarg getopt_data.optarg
     108#define opterr getopt_data.opterr
     109#define optopt getopt_data.optopt
     110#define getopt(argc, argv, opt) getopt_r(argc, argv, "+" opt, &getopt_data)
     111#endif /* __rtems__ */
    68112
    69113        fmt = NOTSET;
     
    73117        opterr = 0;
    74118        while (optind < argc &&
     119#ifndef __rtems__
    75120            strspn(argv[optind], "-aefg") == strlen(argv[optind]) &&
     121#else /* __rtems__ */
     122            strspn(argv[optind == 0 ? 1 : optind], "-aefg") == strlen(argv[optind == 0 ? 1 : optind]) &&
     123#endif /* __rtems__ */
    76124            (ch = getopt(argc, argv, "aef:g")) != -1)
    77125                switch(ch) {
  • freebsd/bin/stty/util.c

    rf6c52e0 r567cce1  
    11#include <machine/rtems-bsd-user-space.h>
    22
     3#ifdef __rtems__
     4#include "rtems-bsd-stty-namespace.h"
     5#endif /* __rtems__ */
    36/*-
    47 * Copyright (c) 1991, 1993, 1994
     
    3841__FBSDID("$FreeBSD$");
    3942
     43#ifdef __rtems__
     44#include <machine/rtems-bsd-program.h>
     45#endif /* __rtems__ */
    4046#include <sys/types.h>
    4147#include <sys/stat.h>
     
    4854#include "stty.h"
    4955#include "extern.h"
     56#ifdef __rtems__
     57#include "rtems-bsd-stty-util-data.h"
     58#endif /* __rtems__ */
    5059
    5160/*
Note: See TracChangeset for help on using the changeset viewer.