• 沒有找到結果。

Process Control

N/A
N/A
Protected

Academic year: 2022

Share "Process Control"

Copied!
27
0
0

加載中.... (立即查看全文)

全文

(1)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

Contents

1. Preface/Introduction

2. Standardization and Implementation 3. File I/O

4. Standard I/O Library 5. Files and Directories

6. System Data Files and Information 7. Environment of a Unix Process 8. Process Control

9. Signals

10.Inter-process Communication

Process Control

ƒ Objective

ƒ Process Control: Process Creation and Termination, Program Execution, etc.

ƒ Process Properties and Accounting

ƒE.g., ID’s.

ƒ Related Functions

ƒE.g., system()

ƒ Process Identifiers

ƒ Process ID – a nonnegative unique integer

ƒtmpnam

(2)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

Process Control

ƒ Special Processes

ƒ PID 0 – Swapper (I.e., the scheduler)

ƒ Kernel process

ƒ No program on disks correspond to this process

ƒ PID 1 – init responsible for bringing up a Unix system after the kernel has been

bootstrapped. (/etc/rc* & init or /sbin/rc* & init)

ƒ User process with superuser privileges

ƒ PID 2 - pagedaemon responsible for paging

ƒ Kernel process

Memory Management

ƒ Virtual Memory – Demand paging

File System

Swap Space Run

Swap-Out Swap-In

CPU MMU

Page Table

TLB

Logical Address

Memory

Physical Address

(3)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

Memory Management

ƒ Demand Paging

ƒ Page fault -> disk I/O -> modify the page table -> rerun the instruction!

F

P D

P

F D

page fault disk I/O

File System / Swap Space

Memory

Logical Address Physical Address

Page Table

Process Control

#include <sys/types.h>

#include <unistd.h>

pid_t getpid(void);

pid_t getppid(void);

uid_t getuid(void);

uid_t geteuid(void);

gid_t getgid(void);

gid_t getegid(void);

ƒ None of them has an error return.

(4)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

fork

#include <sys/types.h>

#include <unistd.h>

pid_t fork(void);

ƒ The only way beside the bootstrap process to create a new process.

ƒ Call once but return twice

ƒ 0 for the child process (getppid)

ƒ Child pid for the parent (1:n)

ƒ Copies of almost everything but no sharing of memory, except text

ƒ Copy-on-write (fork() – exec())

fork

ƒ Program 8.1 – Page 189

ƒ fork(), race conditions, write vs standard I/O functions

ƒ File sharing

ƒ Sharing of file offesets (including stdin, stdout, stderr)

Tables of Opened Files (per process)

System Open File Table

In-core i-node list

(5)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

fork

ƒ Normal cases in fork:

ƒ The parent waits for the child to complete.

ƒ The parent and child each go their own way (e.g., network servers).

ƒ Inherited properties:

ƒ Real/effective [ug]id, supplementary gid, process group ID, session ID, controlling terminal, set[ug]id flag, current working dir, root dir, file-mode creation mask, signal mask & dispositions, FD_CLOEXEC flags, environment, attached shared memory segments, resource limits

ƒ Differences on properties:

ƒ Returned value from fork, process ID, parent pid, tms_[us]time, tms_c[us]time, file locks, pending alarms, pending signals

fork

ƒ Reasons for fork to fail

ƒ Too many processes in the system

ƒ The total number of processes for the real uid exceeds the limit

ƒ CHILD_MAX

ƒ Usages of fork

ƒ Duplicate a process to run different sections of code

ƒ Network servers

ƒ Want to run a different program

ƒ shells (spawn = fork+exec)

(6)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

vfork

ƒ Design Objective

ƒ An optimization on performance

ƒ Execute exec right after returns from fork.

ƒ Mechanism – SVR4 & 4.3+BSD

ƒ Since 4BSD

ƒ <vfork.h> in some systems

ƒ No copying of the parent’s address space into the child.

ƒ Sharing of address space

vfork

ƒ vfork() is as the same as fork() except

ƒ The child runs in the address space of its parent.

ƒ The parent waits until the child calls exit or exec.

ƒA possibility of deadlock

ƒ Program 8.2 – Page 194

ƒ vfork, _exit vs exit (flushing/closing of stdout)

(7)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

exit

ƒ Five ways to terminate:

ƒ Normal termination

ƒ Return from main().

ƒ Call exit() – ANSI C

ƒ Incomplete in Unix – filedes, multiple processes & job control

ƒ Call _exit() – POSIX.1

ƒ Abnormal termination

ƒ Call abort()

ƒ Generate SIGABRT

ƒ Be terminated by a signal.

exit

ƒ Termination

ƒ The same code in the kernel is finally executed.

ƒClose all open descriptors, release memory, and the like.

ƒ Exit status vs termination status

ƒExit status (arg from exit, _exit, or return) Æ termination status

ƒIn abnormal case, the kernel generate it.

ƒwait & waitpid

(8)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

exit

ƒ zombie

ƒ The process which has terminated, but its parent has not yet waited for it.

ƒ Order of terminations

ƒ The parent before the child

ƒInherited by init

ƒ When a parent terminates, it is done by the kernel.

ƒ Clean up of the zombies by the init – wait whenever needed!

ƒ Otherwise

ƒKeep some minimum info for the parent

wait & waitpid

#include <sys/types.h>

#include <sys/wait.h>

pid_t wait(int *statloc);

pid_t waitpid(pid_t pid, int *statloc, int op);

ƒ wait will block until one child terminates or an error could be returned.

ƒwaitpid could wait for a specific one and has an option not to be blocked. + job ctrl

ƒ SIGCHILD from the kernel if a child terminates

ƒ Default action is ignoring.

(9)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

wait & waitpid

ƒ Three situations in calling wait/waitpid

ƒ Block

ƒ Return with the termination status of a child

ƒ Return with an error.

ƒ Termination Status <sys/wait.h> – Figure 8.2

ƒ Exit status (WIFEXITED, WEXITSTATUS)

ƒ Signal # (WIFSIGNALED, WTERMSIG)

ƒ Core dump (WCOREDUMP)

ƒ Others (WIFSTOPPED, WSTOPSIG)

wait & waitpid

ƒ Program 8.3 – Page 199

ƒ pr_exit, mapping of signal numbers

<signal.h>

pid_t waitpid(pid_t pid, int *statloc, int op);

ƒ pid

ƒ pid == -1 Æ wait for any child

ƒ pid > 0 Æ wait for the child with pid

ƒ pid == 0 Æ wait for any child with the same group id

ƒ pid < -1 Æ wait for any child with the group ID = |pid|

ƒ pid of the child or an error is returned.

(10)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

wait & waitpid

ƒ Errors

ƒNo such child or wrong parent

ƒ Option for waitpid

ƒWNOHANG, WUNTRACED

ƒWNOWAIT, WCONTINUED (SVR4)

ƒ Program 8.4 – Page 200

ƒ Different exit status

ƒ Program 8.5 – Page 202

ƒ Forking twice – inheritance by init

wait3 & wait4

#include <sys/types.h>

#include <sys/wait.h>

#include <sys/time.h>

#include <sys/resource.h>

pid_t wait3(int *statloc, int op, struct rusage

*rusage);

pid_t wait4(pid_t pid, int *statloc, int op, struct rusage *rusage);

ƒ 4.3+BSD – Figure 8.4, Page 203

ƒ User/system CPU time, # of page

faults, # of signals received, the like.

(11)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

Race Conditions

ƒ Def: When multiple processes are trying to do something with shared data, the final outcome depends on the order in which the processes run.

ƒ Example: Program 8.5 – Page 202

ƒ Who is the parent of the 2ndchild?

ƒ Program 8.6 – Page 205

ƒ Mixture of output by putc + setting of unbuffering for stdout

Race Conditions

ƒ How to synchronize?

ƒ Waiting loops?

ƒ Inter-Process Communication facility, such as pipe (Program 14.3), fifo, semaphore, shared memory, etc.

ƒ Program 8.7 – Page 206

ƒ WAIT_PARENT(), TELL_CHILD(), WAIT_CHILD(), TELL_PARENT()

while (getppid() != 1) sleep(1);

Parent:

TELL_CHILD(pid);

Child:

WAIT_PARENT (getppid());

(12)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

exec

ƒ Replace the text, data, heap, and stack segments of a process with a program!

#include <unistd.h>

int execl(const char *pathname, const char

*arg0, … /* (char *) 0 */);

int execv(const char *pathname, char *const argv[]);

int execle(const char *pathname, const char

*arg0, … /* (char *) 0, char *const envp[] */);

int execve(const char *pathname, char *const argv[], char *const envp[]);

ƒ l, v, and e stands for list, vector, and environment, respectively.

exec

#include <unistd.h>

int execlp(const char *filename, const char

*arg0, … /* (char *) 0 */);

int execvp(const char *filename, , char *const argv[]);

ƒ With p, a filename is specified unless it contains ‘/’.

ƒPATH=/bin:/usr/bin:.

ƒ/bin/sh is invoked with “filename” if the file is not a machine executable.

ƒExample usage: login, ARG_MAX (4096)

ƒ Figure 8.5 – Page 209 (6 exec functions)

(13)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

exec

ƒ Inherited from the calling process:

ƒ pid, ppid, real [ug]id, supplementary gid, proc gid, session id, controlling terminal, time left until alarm clock, current working dir, root dir, file mode creation mask, file locks, proc signal mask, pending signals, resource limits, tms_[us]time, tms_cutime, tms_ustime

ƒ FD_CLOEXEC flag

ƒ Requirements & Changes

ƒ Closing of open dir streams, effective user/group ID, etc.

exec

ƒ In many Unix implementations, execve is a system call.

ƒ Program 8.8 – Page 211

ƒ Program 8.9 – Page 212

ƒ The prompt bet the printing of argv[0] and argv[1].

execvp execlp

execv execl

execve execle

build argv build argv build argv

try each PATH prefix

use environ

(14)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

User/Group ID’s

#include <sys/types.h>

#include <unistd.h>

int setuid(uid_t uid);

ƒ The process == superuserÆ set real/effective/saved-suid = uid

ƒ Otherwise, euid=uid if uid == ruid or uid

== saved-suid

ƒ Or errno=EPERM (_POSIX_SAVED_IDS) int setgid(gid_t gid);

ƒ The same as setuid

User/Group ID’s

ƒ Remark – Figure 8.7, Page 214

ƒ Only superuser process can change the real uid – normally done by the login program.

ƒ The euid is set by exec only if the setuid bit is set for the program file.

euid can only be set as its saved-suid or ruid.

ƒ exec copies the euid to the saved-suid (after the setting of euid if setuid bit is on).

(15)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

User/Group ID’s

ƒ Example tip (BSD) or cu (SV) – Page 214

ƒ The setuid bit is on for tip (owner=uucp).

ƒFor file locking

ƒ Tip calls setuid(ruid) for file access &

later creating of shells/processes

ƒCorrect uid

ƒ Switch the euid back to uucp

ƒ Remark: Not good for files with setuid = root!

User/Group ID’s

#include <sys/types.h>

#include <unistd.h>

int setreuid(uid_t ruid, uid_t euid);

int setregid(uid_t rgid, uid_t egid);

ƒ Swapping of real and effective uids.

ƒGood for even unprivileged users.

ƒ BSD only or BSD-compatibility library

(16)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

User/Group ID’s

#include <sys/types.h>

#include <unistd.h>

int seteuid(uid_t uid);

int setegid(uid_t gid);

ƒ Non-superusers can only set euid=ruid or saved-setuid.

ƒ A privileged user only sets euid = uid.

ƒ It is different from setuid(uid)

User/Group ID’s

ƒ The supplementary guid’s are not affected by the setgid function.

real uid effective uid saved suid

superuser setreuid(ruid, euid)

superuser setuid(uid)

superuser seteuid(uid)

nonsuperuser setuid or seteuid

nonsuperuser setuid or seteuid ruid

euid uid uid uid

uid

nonsuperuser setreuid

nonsuperuser setreuid exec of suid

(17)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

Interpreter Files

ƒ Def: a file begins with a line of the form: #! pathname [optional-argument]

ƒ E.g., “#! /bin/sh”

ƒ Implementation:

ƒ Recognition is done within the kernel

ƒ Interpreter (normally an absolute pathname) vs the interpreter files

ƒ Line-limit of the first line, e.g., 32 chars.

ƒ Program 8.10 – Page 218

ƒ Argument list, arg pathname of execl()

Interpreter Files

ƒ Program 8.11 – Page 219

ƒ “awk –f myfile” lets awk to read an awk program from “myfile”.

ƒ Argument list: awkexample file1 FILE2 f3 (at /usr/local/bin/)

#! /bin/awk –f BEGIN {

for (i = 0; i < ARGC; i++)

printf “ARGV[%d] = %s\n”, i, ARGV[i]

exit }

ƒ /bin/awk –f /usr/local/bin/awkexample file1 FILE2 f3

ƒ Page 219

(18)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

Interpreter Files

ƒ Example: Removing of “-f”

$su Passwd:

# mv /bin/awk /bin/awk.save

# cp /home/stevens/bin/echoarg /bin/awk

# suspend [1] + Stopped su

$arkexample file1 FILE2 f3 argv[0]: /bin/awk

argv[1]: -f

argv[2]: /usr/local/bin/awkexample argv[3]: file1

argv[4]: FILE2 argv[5]: f3

Interpreter Files

ƒ Why interpreter files?

ƒ Pro:

ƒHid the fact that certain programs are scripts in other languages.

ƒEasy to use (wrapping programs).

ƒexeclpÆ /bin/sh Æ fork, exec,wait

ƒChoices of shells

ƒ Against:

ƒEfficiency for users but at the cost of the kernel

ƒExecutable files? /bin/sh? /bin/awk?

(19)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

system

#include <stdlib.h>

int system(const char *cmdstring);

ƒ If cmdstring = null, return nonzero only if a command interpreter is available.

ƒ Objective:

ƒ Convenient in usage

ƒ system(“date > file”);

ƒ Or write a program: call time, localtime, strftime, write, etc.

ƒ ANSI C definition Æ system-dependent

ƒ An interface to shells

system

ƒ Implementation: fork-exec-waitpid

ƒ Program 8.12 – Page 223

ƒ The implementation of system()

ƒ The shell’s –c tells to take next cmd-line argument as its command input –

parameter passing, meta chars, path, etc.

ƒ Call _exit(127)

ƒ Returns –1 if fork fails or waitpid returns error other than EINTR (a caught signal).

ƒ Returns 127 if exec fails.

ƒ Return the termination status of the shell (in the format for waitpid)

(20)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

system

ƒ Program 8.13 – Page 224

ƒ Calling system()

ƒ Advantage

ƒ system() does all the error handling/

signal handling

ƒ A security hole

ƒ Call system from a setuid program

ƒ Programs 8.14 & 8.15 – Page 225

ƒ A set[ug]id program should change its uid’s back to the normal after call fork.

Process Accounting

ƒ Non-POSIX standards

ƒ SVR4 & 4.3+BSD supported

ƒ accton [filename]

ƒ /var/adm/pacct or /usr/adm/acct

typedef u_short comp_t;

struct acct {

char ac_flag; /* Figure 8.9 – Page 227 */

char ac_stat; /* termination status (core flag + signal #) */

uid_t ac_uid; gid_t ac_gid; /* real [ug]id */

dev_t ac_tty; /* controlling terminal */

time_t ac_btime; /* staring calendar time (seconds) */

comp_t ac_utime; /* user CPU time (ticks) */

comp_t ac_stime; /* system CPU time (ticks) */

comp_t ac_etime; /* elapsed time (ticks) */

comp_t ac_mem; /* average memory usage */

comp_t ac_io; /* bytes transferred (by r/w) */

comp_t ac_rw; /* blocks read or written */

char ac_comm[8]; /* command name: [8] for SVR4, [10] for 4.3 BSD */

};

(21)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

Process Accounting

ƒ Accounting Information

ƒ Kept in the process table whenever a new process is created.

ƒ Each accounting record is written into the accounting file in the order of the termination order of

processes.

Process Accounting

ƒ A new record for each process

ƒ E.g., A execs B, then B execs C

ƒac_flag: AFORK is cleared. (cmd=C)

ƒ Programs 8.16 & 8.17 – Page 228-230

sleep(2) exit(2)

sleep(4) abort()

fork fork

parent first child second child

sleep(8) exit(0) fork

third child

sleep(6) kill() fork

second child

execl /usr/bin/dd Remark: 60 ticks/sec

etime=128 etime=274

stat=128+6 stat=9

etime=360

(22)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

User Identification

#include <unistd.h>

char *getlogin(void);

ƒ Fail if the process is not attached to a terminal – daemons

ƒ A user could have a multiple login names – login’s user name

ƒgetpwuid, getpwnam

ƒFunction ttyname – utmp

ƒEnvironment var LOGNAME (set by the login process in 4.3+BSD) – user-space data

Process Times

#include <sys/times.h>

clock_t times(struct tms *buf);

ƒ The Returned value from some arbitrary point in the past.

struct tms {

clock_t tms_utime; /* user CPU time */

clock_t tms_stime; /* system CPU time */

clock_t tms_cutime; /* user CPU time, terminated child */

clock_t tms_cstime; /* system CPU time terminated child */

ƒ Program 8.18 – Page 234

ƒ times

ƒ _SC_CLK_TCK

(23)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

Remark: Logins – Chapter 9

ƒ Terminal Logins – one for each terminal device

ƒ Network Logins – inetd (internet superserver)

ƒ inetd waits for TCP/IP connections

init init getty

initinit

fork exec

getty getty

Login:

getty exec

getty login

passwd:

getty exec

getty shell

#:

init sh

fork inetd inetd

fork telnetd

exec

TCP connection req from a TELNET client fork, exec login

pseudo-terminal The TELNET client

shell

TCP/IP

exec

fork

/etc/rc exec

4.3+BSD Terminal Logins

ƒ execle(“/usr/bin/login”, “login”, “-p”, usrname, (char *) 0, envp)

ƒ ruid = euid = 0

ƒ ppid = 1

ƒ TERM=foo

ƒ gettytab

ƒ Getpwnam; getpass; crypt

ƒ pw_passwd

ƒ Fail Æ exit; init forks; exec(getty)

ƒ Succeed Æ home dir (chdir);

terminal device (chown); terminal access rights; setgid; initgroups;

envp (HOME, PATH, etc), setuid, execl(“/usr/bin”, “-sh”, (char *)0) init

init fork

exec

getty exec login

Read /etc/ttys

Fork once per terminal;

create empty env

Open terminal device (filedes 0, 1, 2) Read username;

initial env list login

passwd

(24)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

4.3+BSD Terminal Logins

ƒ Login shell

ƒ Read the start-up files (.profile for Bourne shell and KornShell, .cshrc and .login for C shell)

ƒ When a login shell terminates, init is

notified, and the whole procedure restarts!

ƒ SVR4: (1) getty (2) ttymon

ƒ Init Æ sac Æ ttymon Æ login Æ login shell

fork; exec fork; exec exec

Network Logins – 4.3+BSD

ƒ Regardless of terminal or network logins, the file descriptors 0, 1, 2 of a login shell is connected to a terminal device or a pseudo- terminal device.

ƒ Login does more things

ƒ Checking of new mail, etc.

ƒ SVR4

ƒ Parent(inetd) = service access controller (sac) init

login shell

fd 0, 1, 2 pseudo-terminal

device driver

user at a terminal

through inetd, telnetd, and login

network connection through

telnetd server and telnet client

(25)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

Remark: Session, Controlling Terminal, Job Control – Ch 9

ƒ Session – a collection of one or more process groups

Proc1 | Proc2 &

Proc3 | Proc4 | Proc5

ƒ Controlling Terminal – (pseudo) terminal device we log in!

ƒ Foreground/background process grp ( ^C Æ who?)

ƒ Job Control

ƒ Start multiple jobs (grp of processes) from a terminal and control which jobs can access the terminal and which jobs run in the background.

shell The fg proc grp

Process Groups

ƒ Process Group

ƒ A collection of one or more processes

ƒ Unique process group ID

#include <sys/types.h>

#include <unistd.h>

pid_t getpgrp(void);

pid_t setpgid(pid_t pid, pid_t pgid);

ƒ PID (leader) = process group ID

ƒ pid = 0 Æ pid of the caller, gpid=0 Æ gpid=pid

ƒ Can only set the pgrp of itself and its children (without exec)

ƒ proc | proc2

(26)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

Sessions

ƒ Session

ƒ A collection of one or more process groups

#include <sys/types.h>

#include <unistd.h>

pid_t setsid(void);

ƒ A new session is created if the calling

process is not a process group leader Æ the session leader, the process group leader

ƒNo controlling terminal

ƒ Otherwise; an error is returned!

Controlling Terminal

ƒ Controlling Terminal – (pseudo) terminal device we log in!

ƒ Controlling process – the session leader that establishes the connection to the controlling terminal

ƒ With a controlling terminal Æ one foreground pgrp & N background pgrps

ƒ open(/dev/tty)?

ƒ Foreground/background process grp: terminal inputs, signal (e.g., ^C, ^Z) Æ who?

(27)

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.

Job Control

ƒ Job Control – control which jobs

(groups of processes) can access the terminal and which jobs are to run in the background!

ƒ Shell, terminal driver, signals

ƒ _POSIX_JOB_CONTROL

ƒ SVR4, 4.3+BSD, POSIX.1

ƒ ^Z Æ SIGSTP, ^C Æ SIGINT, ^\ Æ SIGQUIT Î foreground pgrp!

ƒ pr * | lpr & (P250)

ƒ fg

Job Control

ƒ SIGTTIN – sent by the terminal driver for a background job that try to reads from the terminal.

#include <sys/types.h>

#include <unistd.h>

pid_t tcgetpgrp(int filedes);

pid_t tcsetpgrp(int filedes, pid_t pgrpid);

ƒ Shell could call tcsetpgrp to set the

foreground process group ID to pgrpid, where filedes refers to the controlling terminal.

參考文獻

相關文件

– Each time a file is opened, the content of the directory entry of the file is moved into the table.. • File Handle (file descriptor, file control block): an index into the table

• Make sure your terminal handles 中文 well
 keyword: encoding, UTF-8, or Big5.. • Choose a

• Make sure your terminal handles 中⽂文 well
 keyword: encoding, UTF-8, or Big5.. • Choose a

• Make sure your terminal handles 中⽂文 well
 keyword: encoding, UTF-8, or Big5.. • Choose a

A “charge pump”: a device that by doing work on the charge carriers maintains a potential difference between a pair of terminals.. Æan emf device

 Local, RADIUS, LDAP authentication presents user with a login page.  On successful authentication the user is redirected to

The PROM is a combinational programmable logic device (PLD) – an integrated circuit with programmable gates divided into an AND array and an OR array to provide an

¾ PCS systems can connected to Public Switched Telephone Network (PSTN)6. ¾ Goal of PCS:enabling communications with a person at anytime, at any place and in any