muḍāriʿـُيَفْعُلُmaṣdarهُجُودٌ
Core sense — he slept in the night; he stayed awake at night to praygenerated
1.1
He (a man) slept; or slept in the night; or slept in the latter part of the night.
maṣdar هُجُودٌ, تهجّد, اهجد and هجّد.
1.1.1he remained awake, sleepless, in the night—هَجَدَ
In some copies the first of these verbs is written هجّد.
And so praying in the night is called تَهَجُّدٌ. Or: he awoke from sleep to pray, or for some other purpose; or he prayed in the night.
he remained awake, sleepless, in the night—تهجّد
he prayed in the night—هجّد
he gave up sleep for prayer—تهجّد
So in the Qur'ān 17:81.
on this sense So these verbs carry two opposite meanings.
Show Lane's original text
, (S, A, L, Msb,) aor. هَجُدَ , (L, Msb,) inf. n. هُجُودٌ ; (L, Msb, K;) and تهجّد , (S, A, L, Msb, K,) and اهجد , (L, K,) and هجّد ; (IAar, L;) He (a man, L) slept: (L, Msb, K:) or slept in the night: (IAar, S, A, L:) or, in the latter part of the night. (L.) Also هَجَدَ and تهجّد (S, A, L, Msb, K [in some copies, of the last of which the former verb is written هجّد and so in the TA) He remained awake, or was sleepless or wakeful in the night: (S, A, L:) and hence the praying in the night is called تَهَجُّدٌ : (S, L:) or he awoke from sleep (K) to pray, or for some other purpose: (TA:) or he prayed in the night; (Msb;) as also هجّد : (IAar, L:) thus these verbs bear two contr. significations: (S, A, L, Msb, K:) and تهجّد he relinquished sleep for prayer: (A:) so in the Kur, xvii., 81. (Beyd.)