⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unix to windows nt.txt

📁 本文是介绍如何从UNIX到NT程序的可移植技术,(国内是没有这方面的资料,所以是E文哦)
💻 TXT
📖 第 1 页 / 共 5 页
字号:






        4.6  Parent/Child_Relationships   4.8  Ids_and_Permissions

        The WIN32  subsystem  does  not   Windows   NT    uses    subject
        support            parent/child   identifiers  to  identify users
        relationships           between   and    groups.     A    subject
        processes.   The  process  that   identifier consists of an array
        calls  CreateProcess()  can  be   of numbers  that  identify  the
        thought  of  as the parent, but   administrative   authority  and
        there is no way for a child  to   sub-authorities associated with
        determine   its  parent.   Most   a  given  user.  A UNIX user or
        resources, such  as  files  and   group id  is  a  single  number
        processes,  have  handles  that   that uniquely identifies a user
        can  be  inherited   by   child   or group only within  a  single
        processes    and    passed   to   system.     Information   about
        unrelated    processes.     Any   users is kept in the a registry
        process  can  wait  for another   database  which  is  accessible
        process to complete if  it  has   via the WIN32 API and  the  LAN
        an open handle to that process.   manager API.
        There is a limited  concept  of
        process  group that affects the   Windows  NT  uses   an   access
        distribution    of     keyboard   control  list,  ACL,   on  each
        signals,  and  a process can be   file or object to  control  the
        placed  in  a  new   group   at   access  of  the  file or object
        startup   or  can  inherit  the   for each user.  UNIX uses a set
        group of  the  parent  process.   of  permission  bits associated
        There  is  no way to get or set   with  the  three   classes   of
        the   process   group   of   an   users; the owner of the object,
        existing process.                 the  group  that   the   object
                                          belongs  to, and everyone else.
        4.7  Signals                      While   it   is   possible   to
                                          construct   an  access  control
        The  WIN32   API   provides   a   list   that   more   or    less
        structured     mechanism    for   corresponds  to  a  given  UNIX
        exception   handling.     Also,   permission, it  is  not  always
        signals generated from within a   possible  to  represent a given
        process are  supported  by  the   access control list  with  UNIX
        API.       However,     signals   permissions.
        generated  by  another  process
        have   no   direct   method  of   Windows   NT    has    separate
        implementation.  In addition to   permissions for writing a file,
        being    able    to   interrupt   deleting  a   file,   and   for
        processing  at  any  point,   a   changing  the  permission  on a
        signal  handler might perform a   file.  The write  bit  on  UNIX
        longjmp and never return.         systems  determines  all three.
                                          Thus,   it   is   possible   to
                                          encounter   files   that   have
                                          partial write capability.

                                          UNIX processes  have  real  and
                                          effective  user  and group id's













        that    control    access    to   to the screen.
        resources.   Windows NT assigns
        each process a  security  token   4.10  Special_Files
        that   defines   the   set   of
        privileges that it  has.   UNIX   The WIN32 API supports  unnamed
        systems  use  setuid/setgid  to   pipes  with the UNIX semantics.
        delegate      privileges     to   Named pipes are also  supported
        processes.   Windows  NT uses a   but  have  different  semantics
        technique called  impersonation   than   fifos   and   occupy   a
        to carry out commands on behalf   separate  name space.  There is
        of a given user.  There  is  no   no  /dev  directory   to   name
        user    that    has   unlimited   special  files such as /dev/tty
        privileges  as  the  root  user   and /dev/null.  The WIN32  does
        does  with  UNIX.   Instead the   support  special  names  of the
        special privileges of root have   form \\.\PhysicalDrive for disk
        been broken apart into separate   drives and tape drive devices.
        privileges that can be given to
        one  or more users.  One of the   Windows NT supports hard  links
        biggest challenges we faced was   to files, but there is no WIN32
        providing  the  UNIX  model  of   API call to create these links.
        setuid/setgid on top of the WIN   They  do  not  support symbolic
        32 interface.                     links  in   the   file   system
                                          directly, but on Windows 95 and
        The implementation of WIN32 for   on Windows  NT  4.0,  the  file
        Windows 95 does not support the   browser does support short cuts
        NT  security  model  and  calls   which  are  very   similar   to
        return a not implemented error.   symbolic links.

        4.9  Terminal_Interface           4.11  Shared_libraries

        Windows NT and Windows 95 allow   The  WIN32  API  supports   the
        each       character      based   linking  of shared libraries at
        application  to  be  associated   program invocation and  at  run
        with a console which is similar   time.  The libraries are called
        to an xterm  window.   Consoles   dynamically linked libraries or
        support  echo and no echo mode,   DLL's  and  are  represented by
        and line at a time or character   two separate files.   One  file
        at  a time input mode, but lack   provides  the  interface and is
        many of the other  features  of   needed  at  compile   time   to
        the  POSIX  termios  interface.   satisfy   external  references.
        There   is   no   support   for   The second  file  contains  the
        processing   escape   sequences   implementation  as is needed at
        that are sent  to  the  console   run time.
        window.     In    echo    mode,
        characters are  echoed  to  the   There are some restrictions  on
        console  when  a  read  call is   DLL's  that  are  not  found on
        pending,  not  while  they  are   UNIX  system   shared   library
        typed.    There   are  separate   implementations.            One
        console  handles  for   reading   restriction is that you  cannot
        from  the  keyboard and writing   override a function called by a













        DLL  by  providing   your   own   variables,  such  as  PATH  are
        version of the function.  Thus,   used by both WIN32 and by UNIX,
        supplying your own malloc() and   yet   have  different  formats.
        free()   functions   will   not   UNIX uses a :   separated  list
        override the calls to  malloc()   of  pathnames;  WIN32  uses a ;
        and free() made by other DLL's.   separated list.
        Secondly, the library can  only
        contain  pointers  to data, not
        data itself.   Thus,  making  a   5.  COMMERCIAL POSIX LIBRARY
        symbol  such as errno part of a       INTERFACES
        DLL is impossible.  Even making
        symbols  such as stdin point to   We purchased software from  the
        data in a DLL  invites  trouble   two  commercial vendors that we
        since  it  is  not  possible to   were aware of that  sell  POSIX
        compile code that uses            libraries  for  Windows NT that
            static   FILE   *myfile   =   run under the WIN32  subsystem.
        stdin;                            Each    offers    a    software
                                          development   kit    containing
        4.12  Compilers_and_libraries     include  files  and  libraries,
                                          and each offers a set  of  UNIX
        Microsoft  sells   the   Visual   utilities.    Both   of   these
        C/C++  compiler  for Windows NT   vendors require  a  license  to
        and Windows 95.  This  compiler   use    their    libraries    in
        has   both   a   graphical  and   products.   We   used   earlier
        command     line     interface.   versions  of their products but
        Microsoft also sells a software   based on their web pages at the
        developers   kit   (SDK)   that   time  this  paper  was written,
        contains  tools,  including the   the following description still
        Microsoft nmake.  The  compiler   applies.  Both of these vendors
        and  linker use a different set   supply cc commands that  invoke
        of  flags  than  standard  UNIX   the underlying Microsoft Visual
        compilers,  and C files produce   C/C++  compiler.   Neither   of
        .obj files by  default,  rather   these products support symbolic
        than  .o  files.   Fortunately,   links, job control  and  fifos.
        the linker can handle both .obj   Both appear to have implemented
        and  .o  files.  The linker has   the exec*() family  incorrectly
        options to  choose  a  starting   in  that  the process that does
        address  and to specify whether   the  exec  does  not  terminate
        the application  is  a  console   until    the    child   process
        application, a GUI application,   completes.   A   process   that
        a  POSIX  application,   or   a   repeatedly  execs  itself  will
        dynamically linked library.       eventually cause the  operating
                                          system to run out of processes.
        4.13  Environment_Variables       It is not clear from their home
                                          pages  whether  either of these
        The  WIN32  API  supports   the   products work with Windows 95.
        creation    and    export    of
        environment variables  in  much
        the  same way that UNIX systems
        do.       Some      environment













        5.1  NuTCracker_from_DataFocus    5.2  Portage_from_Consensys

        NuTCracker, by  Datafocus,  URL   The  other  product   that   we
        http://www.datafocus.com, makes   purchased  is named Portage and
        an  attempt  to  support   UNIX   is sold by  Consensys  Systems,
        conventions.   It  maps Windows   URL   http://www.consensys.com.
        NT file names to and from  UNIX   The source is based  on  System
        file  names,  and  adjusts  the   V,  Release  4,  which makes it
        PATH    environment    variable   the more suitable for most AT&T
        accordingly.   For  example, it   products.  Their utilities were
        maps the Windows NT  file  name   built from the System V source,
        d:\bin  to  the  UNIX  filename   but  it  was clear that changes
        /d=/bin and handles the special   were made in order to port them
        names  /dev/null  and /dev/tty.   to Windows NT.
        The = is a poor choice  because
        the  POSIX.2  standard  for the   Portage Version  1.0  does  not
        shell   language   leaves   the   map  Windows  NT file name into
        behavior  of commands that have   UNIX names.  They have modified
        an = in their name unspecified.   some   tools  such  as  ksh  to
                                          recognize   ;   as   the   PATH
        NuTCracker   ships   the    MKS   delimiter   in   place   of  :.
        Toolkit  as the utilities.  The   Version  1.0  did  not  support
        MKS  Toolkit  is  a  completely   case   distinction,  but  their
        independent implementation that   home page indicates  that  they
        does  not  use  the  NuTCracker   now do.
        libraries.   We  view this as a
        serious  deficiency  since  the   In terms of functionality,  the
        behavior or the utilities is no   NuTCracker    suite   is   more
        guide as to the correctness  or   complete than Portage.
        functionality of the NuTCracker
        library.
                                          6.  UWIN DESIGN AND
        The  NuTCracker  library  lacks       IMPLEMENTATION
        some  functions  not defined by
        POSIX  or  ANSI  C   that   are   We started work on writing  our
        available  on UNIX systems such   own   POSIX   library   at  the
        as hsearch() and cuserid().       beginning of 1995  after  being
                                          frustrated  with  the  existing
        In  addition   to   the   above   commercial products.   We  were
        deficiencies,  NuTCracker  does   able  to  put together a useful
        not   support   filename   case   subset of functions in about  3
        distinction.                      months.     However,    to   be
                                          successful, it was necessary to
        NuTCracker  supports  a   Motif   provide  as  complete a package

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -