  We establish sharp boundary regularity estimates in $C^1$ and $C^{1,\alpha}$
domains for nonlocal problems of the form $Lu=f$ in $\Omega$, $u=0$ in
$\Omega^c$. Here, $L$ is a nonlocal elliptic operator of order $2s$, with
$s\in(0,1)$. First, in $C^{1,\alpha}$ domains we show that all solutions $u$
are $C^s$ up to the boundary and that $u/d^s\in C^\alpha(\bar\Omega)$, where
$d$ is the distance to $\partial\Omega$. In $C^1$ domains, solutions are in
general not comparable to $d^s$, and we prove a boundary Harnack principle in
such domains. Namely, we show that if $u_1$ and $u_2$ are positive solutions,
then $u_1/u_2$ is bounded and H\"older continuous up to the boundary. Finally,
we establish analogous results for nonlocal equations with bounded measurable
coefficients in non-divergence form. All these regularity results will be
essential tools in a forthcoming work on free boundary problems for nonlocal
elliptic operators \cite{CRS-obstacle}.
